{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/astranexo-com/json-schema/astranexo-com-webhook-schema.json",
  "title": "Webhook",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/astranexo-com-webhooks-api-openapi.yml#/components/schemas/Webhook",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookEvent"
      }
    },
    "is_active": {
      "type": "boolean"
    },
    "timeout_seconds": {
      "type": "integer"
    },
    "max_retries": {
      "type": "integer"
    },
    "last_triggered_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "failure_count": {
      "type": "integer",
      "description": "Entregas fallidas consecutivas; a las 10 el webhook se desactiva."
    },
    "disabled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "disabled_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "WebhookEvent": {
      "type": "string",
      "enum": [
        "document.signed",
        "document.queued",
        "document.accepted",
        "document.rejected",
        "document.voided",
        "document.created",
        "document.error",
        "callback.received"
      ],
      "description": "Eventos suscribibles. `document.created`, `document.error` y `callback.received` se aceptan pero actualmente no se emiten."
    }
  }
}