{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/apisign-io/json-schema/apisign-io-webhook-delivery-schema.json",
  "title": "WebhookDelivery",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/apisign-io-webhooks-api-openapi.yml#/components/schemas/WebhookDelivery",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "eventType": {
      "$ref": "#/$defs/WebhookEventType"
    },
    "status": {
      "$ref": "#/$defs/WebhookDeliveryStatus"
    },
    "attempts": {
      "type": "integer"
    },
    "maxAttempts": {
      "type": "integer"
    },
    "responseCode": {
      "type": [
        "integer",
        "null"
      ]
    },
    "responseBody": {
      "type": [
        "string",
        "null"
      ]
    },
    "errorMessage": {
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "lastAttempt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "nextAttempt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "completedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "durationMs": {
      "type": [
        "integer",
        "null"
      ]
    },
    "payload": {
      "type": "object"
    }
  },
  "$defs": {
    "WebhookDeliveryStatus": {
      "type": "string",
      "enum": [
        "pending",
        "success",
        "failed",
        "retrying"
      ]
    },
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "contract_created",
        "contract_sent",
        "contract_resent",
        "contract_viewed",
        "contract_signed",
        "contract_completed",
        "contract_declined",
        "contract_expired",
        "contract_cancelled"
      ]
    }
  }
}