{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/apisign-io/json-schema/apisign-io-webhook-schema.json",
  "title": "Webhook",
  "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/Webhook",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "status": {
      "$ref": "#/$defs/WebhookStatus"
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookEventType"
      }
    },
    "failureCount": {
      "type": "integer"
    },
    "lastSuccess": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "lastFailure": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "contract_created",
        "contract_sent",
        "contract_resent",
        "contract_viewed",
        "contract_signed",
        "contract_completed",
        "contract_declined",
        "contract_expired",
        "contract_cancelled"
      ]
    },
    "WebhookStatus": {
      "type": "string",
      "enum": [
        "active",
        "inactive",
        "failed"
      ]
    }
  }
}