{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/facture-ar/json-schema/facture-ar-webhook-schema.json",
  "title": "Webhook",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/facture-ar-webhooks-api-openapi.yml#/components/schemas/Webhook",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "userId": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "headers": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "Headers propios que se agregan a cada envío"
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookEvent"
      }
    },
    "isActive": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "WebhookEvent": {
      "type": "string",
      "enum": [
        "delegation.completed",
        "invoice.completed",
        "invoice.failed",
        "batch.completed",
        "draft.review_required"
      ]
    }
  }
}