{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/astranexo-com/json-schema/astranexo-com-webhook-input-schema.json",
  "title": "WebhookInput",
  "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/WebhookInput",
  "type": "object",
  "required": [
    "name",
    "url",
    "events"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "`https://`, host público, sin credenciales."
    },
    "events": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/WebhookEvent"
      }
    },
    "is_active": {
      "type": "boolean",
      "default": true
    },
    "timeout_seconds": {
      "type": "integer",
      "minimum": 5,
      "maximum": 60,
      "default": 30,
      "description": "Tiempo de espera por intento (fuera de rango se usa 30)."
    },
    "max_retries": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10,
      "default": 3,
      "description": "Reintentos tras el primer intento (fuera de rango se usa 3; como máximo se hacen 7 intentos en total)."
    }
  },
  "$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."
    }
  }
}