{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendraven-ai/json-schema/sendraven-ai-webhook-delivery-schema.json",
  "title": "WebhookDelivery",
  "description": "One event delivered (or being delivered) to an endpoint, with the outcome of its latest attempt.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendraven-ai-webhook-endpoints-api-openapi.yml#/components/schemas/WebhookDelivery",
  "type": "object",
  "required": [
    "id",
    "event",
    "status",
    "attempts",
    "last_status_code",
    "last_error",
    "created_at",
    "delivered_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "event": {
      "type": "string",
      "enum": [
        "inbound",
        "send",
        "delivery",
        "bounce",
        "complaint",
        "reject",
        "open",
        "click",
        "rendering_failure",
        "delivery_delay",
        "unsubscribe"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "success",
        "failed"
      ],
      "description": "pending before the first attempt finishes, success once an attempt got a 2xx, failed after an attempt that did not. A failed delivery with fewer than six attempts is still being retried."
    },
    "attempts": {
      "type": "integer",
      "description": "Attempts made so far, at most six."
    },
    "last_status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The HTTP status the endpoint returned on the most recent attempt that got a response."
    },
    "last_error": {
      "type": [
        "string",
        "null"
      ],
      "description": "The most recent error that prevented a usable response (timeout, refused connection, a redirect, a destination that resolves to a non-public address, the endpoint removed or disabled), up to 500 characters. A later success does not clear it."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the event was queued for this endpoint."
    },
    "delivered_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When an attempt succeeded."
    }
  }
}