{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "WebhookEndpointInput.json",
  "title": "Webhook endpoint (request)",
  "description": "Body for registering or changing an endpoint. On update, every field is optional.",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "An absolute https URL of at most 500 characters, publicly reachable. Required on create."
    },
    "description": {
      "type": "string",
      "description": "At most 200 characters."
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "At least one known event type, or [\"*\"] for all. Required on create."
    },
    "active": {
      "type": "boolean",
      "description": "Default true. Setting true re-enables a disabled endpoint and resets its failure count."
    }
  },
  "required": [
    "url",
    "events"
  ],
  "examples": [
    {
      "url": "https://hooks.example.com/flux",
      "description": "Billing sync",
      "events": [
        "invoice.paid",
        "receipt.issued"
      ]
    }
  ]
}
