{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/CredentialWebhookDTO",
  "title": "CredentialWebhookDTO",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "auth",
        "sync",
        "forward"
      ]
    },
    "operation": {
      "type": "string",
      "enum": [
        "creation",
        "override",
        "refresh"
      ]
    },
    "from": {
      "type": "string"
    },
    "connectionId": {
      "type": "string"
    },
    "authMode": {
      "type": "string",
      "enum": [
        "OAUTH2",
        "API_KEY",
        "BASIC"
      ]
    },
    "providerConfigKey": {
      "type": "string"
    },
    "provider": {
      "type": "string"
    },
    "environment": {
      "type": "string"
    },
    "success": {
      "type": "boolean"
    },
    "endUser": {
      "$ref": "#/components/schemas/CredentialEndUser"
    },
    "error": {
      "$ref": "#/components/schemas/CredentialSessionError"
    },
    "tags": {
      "type": "object"
    }
  },
  "required": [
    "type",
    "operation",
    "from",
    "connectionId",
    "authMode",
    "providerConfigKey",
    "provider",
    "environment",
    "success",
    "endUser"
  ]
}