{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/phone-com/json-schema/phone-com-events-callback-schema.json",
  "title": "EventsCallback",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/phone-com-events-callbacks-api-openapi.yml#/components/schemas/EventsCallback",
  "type": "object",
  "properties": {
    "name": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 128,
      "default": null,
      "description": "Event name"
    },
    "fallback_callback_id": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "default": null,
      "description": "Fallback callback ID"
    },
    "profile_id": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "default": null,
      "description": "Profile ID"
    },
    "enabled": {
      "type": "boolean",
      "default": true,
      "description": "Callback status"
    },
    "mode": {
      "type": "string",
      "default": "HTTPS",
      "enum": [
        "HTTPS",
        "HTTP",
        "APPLICATION",
        "EMAIL"
      ],
      "description": "Callback mode"
    },
    "config": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "URL of the callback"
        },
        "method": {
          "type": "string",
          "enum": [
            "GET",
            "POST",
            "PUT",
            "PATCH",
            "DELETE"
          ],
          "description": "Method of the callback  (default is POST)"
        },
        "headers": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Header name"
              },
              "value": {
                "type": "string",
                "description": "Header value"
              }
            },
            "required": [
              "name",
              "value"
            ]
          },
          "description": "Headers , (default is null)"
        },
        "timeout": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Callback timeout (default is null, system timeout will be used)"
        },
        "email": {
          "type": "string",
          "description": "Email for events delivery"
        },
        "mode": {
          "type": "string",
          "enum": [
            "json",
            "text"
          ],
          "description": "email contents type: json or text (default is json)"
        },
        "rate_limit": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "number": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "description": "Number of events allowed in the period"
            },
            "period": {
              "type": "integer",
              "minimum": 10,
              "maximum": 3600,
              "description": "Period in seconds"
            }
          },
          "required": [
            "number",
            "period"
          ],
          "description": "Rate limit (applicable for 'email' type of callback only)"
        },
        "application": {
          "type": "string",
          "enum": [
            "sms-autoresponder",
            "google-analytics"
          ],
          "description": "Application name (applicable for 'application' type of callback only)"
        },
        "parameters": {
          "type": "object",
          "description": "Application invocation parameters (applicable for 'application' type of callback only)"
        }
      },
      "description": "Config object, configuration of the callback"
    }
  },
  "required": [
    "config"
  ]
}