{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sudomock-com/json-schema/sudomock-com-webhook-delivery-detail-response-schema.json",
  "title": "WebhookDeliveryDetailResponse",
  "description": "A single delivery row WITH the captured request/response detail.\n\nReturned ONLY by the per-delivery detail endpoint; the list endpoints\n(/deliveries, /events) never carry these large fields. Capture rules (latest attempt; a retry overwrites the\nsame row):\n  - request_body / request_headers  -> captured on EVERY delivery attempt.\n  - response_body / response_headers -> captured ONLY on failed/dead attempts\n    (NULL on success, because a 2xx body is intentionally not stored). response_body\n    is truncated to 16384 chars.\n\nRequest and response headers are returned as JSON strings.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sudomock-com-openapi.json#/components/schemas/WebhookDeliveryDetailResponse",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for this delivery."
    },
    "endpoint_id": {
      "type": "string",
      "description": "Identifier of the webhook endpoint this delivery was sent to."
    },
    "job_id": {
      "type": "string",
      "description": "Identifier of the job this event was raised for."
    },
    "event_type": {
      "type": "string",
      "description": "Event type this delivery carries, such as render.succeeded."
    },
    "status": {
      "type": "string",
      "description": "Current state of this delivery, such as delivered or failed."
    },
    "http_status": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "HTTP status code your endpoint returned on the latest attempt."
    },
    "attempt": {
      "type": "integer",
      "description": "Attempt counter for this delivery, rising with each retry."
    },
    "last_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Error recorded for the latest attempt."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Time this delivery was first recorded."
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "description": "Time this delivery was last updated."
    },
    "request_body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The JSON body sent to your endpoint on the latest attempt."
    },
    "request_headers": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Headers sent with the latest attempt, as a JSON string."
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Body your endpoint returned on a failed or dead attempt."
    },
    "response_headers": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Headers your endpoint returned on a failed or dead attempt, as a JSON string."
    }
  },
  "type": "object",
  "required": [
    "id",
    "endpoint_id",
    "job_id",
    "event_type",
    "status",
    "attempt",
    "created_at"
  ]
}