{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telnyx/json-schema/telnyx-webhook-delivery-schema.json",
  "title": "webhook_delivery",
  "description": "Record of all attempts to deliver a webhook.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/telnyx-webhooks-api-openapi.yml#/components/schemas/webhook_delivery",
  "properties": {
    "attempts": {
      "description": "Detailed delivery attempts, ordered by most recent.",
      "items": {
        "$ref": "#/$defs/attempt"
      },
      "type": "array"
    },
    "finished_at": {
      "description": "ISO 8601 timestamp indicating when the last webhook response has been received.",
      "format": "date-time",
      "type": "string"
    },
    "id": {
      "description": "Uniquely identifies the webhook_delivery record.",
      "format": "uuid",
      "type": "string"
    },
    "record_type": {
      "description": "Identifies the type of the resource.",
      "type": "string"
    },
    "started_at": {
      "description": "ISO 8601 timestamp indicating when the first request attempt was initiated.",
      "format": "date-time",
      "type": "string"
    },
    "status": {
      "description": "Delivery status: 'delivered' when successfuly delivered or 'failed' if all attempts have failed.",
      "enum": [
        "delivered",
        "failed"
      ],
      "type": "string"
    },
    "user_id": {
      "description": "Uniquely identifies the user that owns the webhook_delivery record.",
      "format": "uuid",
      "type": "string"
    },
    "webhook": {
      "description": "Original webhook JSON data. Payload fields vary according to event type.",
      "properties": {
        "event_type": {
          "description": "The type of event being delivered.",
          "type": "string"
        },
        "id": {
          "description": "Identifies the type of resource.",
          "format": "uuid",
          "type": "string"
        },
        "occurred_at": {
          "description": "ISO 8601 datetime of when the event occurred.",
          "format": "date-time",
          "type": "string"
        },
        "payload": {
          "additionalProperties": true,
          "type": "object"
        },
        "record_type": {
          "description": "Identifies the type of the resource.",
          "enum": [
            "event"
          ],
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "$defs": {
    "attempt": {
      "description": "Webhook delivery attempt details.",
      "properties": {
        "errors": {
          "description": "Webhook delivery error codes.",
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        "finished_at": {
          "description": "ISO 8601 timestamp indicating when the attempt has finished.",
          "format": "date-time",
          "type": "string"
        },
        "http": {
          "$ref": "#/$defs/http"
        },
        "started_at": {
          "description": "ISO 8601 timestamp indicating when the attempt was initiated.",
          "format": "date-time",
          "type": "string"
        },
        "status": {
          "enum": [
            "delivered",
            "failed"
          ],
          "type": "string"
        }
      }
    },
    "http": {
      "description": "HTTP request and response information.",
      "properties": {
        "request": {
          "description": "Request details.",
          "properties": {
            "headers": {
              "$ref": "#/$defs/http_headers"
            },
            "url": {
              "type": "string"
            }
          }
        },
        "response": {
          "description": "Response details, optional.",
          "properties": {
            "body": {
              "description": "Raw response body, limited to 10kB.",
              "type": "string"
            },
            "headers": {
              "$ref": "#/$defs/http_headers"
            },
            "status": {
              "type": "integer"
            }
          },
          "type": "object"
        }
      }
    },
    "http_headers": {
      "description": "List of headers, limited to 10kB.",
      "items": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "type": "array"
    }
  }
}