{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tessio-eu/json-schema/tessio-eu-set-webhook-request-schema.json",
  "title": "SetWebhookRequest",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tessio-eu-openapi.json#/components/schemas/SetWebhookRequest",
  "type": "object",
  "required": [
    "url"
  ],
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Absolute https URL to receive events. Any other scheme is refused: http with insecure_url, the rest with invalid_url."
    },
    "events": {
      "type": "array",
      "description": "Event types to receive. Omit (or empty) to subscribe to all.",
      "items": {
        "$ref": "#/$defs/WebhookEventType"
      }
    }
  },
  "$defs": {
    "WebhookEventType": {
      "type": "string",
      "enum": [
        "age_check.completed",
        "age_check.expired",
        "age_check.failed",
        "age_check.attempt_failed"
      ],
      "description": "`age_check.completed`: a result is in. `age_check.failed`: a presentation verified but gave no readable answer, because it did not disclose the claim. `age_check.expired`: the request lifetime elapsed with no answer (sandbox checks complete by themselves first). `age_check.attempt_failed`: a presentation failed verification, over either transport, or a wallet sent an error response such as a decline, and the check stays pending, so it is not terminal: the check still ends in one of the other three, announced to an endpoint subscribed to it. It is a notice, not a log: at most one waits unsent per check, one whose check has ended before it is picked up is dropped, and it does not follow the terminal event, except rarely when a delivery is interrupted while being sent. Read the check for `failedAttempts` and `lastFailureCodes`, which count every attempt. An endpoint saved before this event existed stored the events known then, so add it to receive it.\n"
    }
  }
}