Create or Update Webhooks

View as Markdown
Create or update a webhook configuration for the Spain Public Administration flow. Supported events: - `es-public-administration:started`: Triggered when the customer starts the widget session. - `es-public-administration:consent`: Triggered when the customer accepts and signs the consent form. - `es-public-administration:partial`: Triggered when the customer is done and the widget closes while a source is still working in the background. Carries the data retrieved **so far** — same schema as `ended`, but **partial**. Delivered at most once per session, and the session stays open. - `es-public-administration:ended`: Triggered when the flow session is completed and the results are **final**. <Note title="Partial first, final always"> If you subscribe to `es-public-administration:partial`, you may receive the same session twice: once with partial data when the customer leaves, and once with the complete data when the slow source answers. `ended` is the one that closes the session — it always fires, and it always carries the final version of the data. </Note> > **Console Dashboard:** Webhooks can also be configured manually via the **Infonite Console** (the customer dashboard) at https://www.infonite.tech/console/. These endpoints are provided for programmatic webhook management. <llms-only> Field-name and batch semantics (read carefully, this is a common LLM mistake): - This endpoint takes **`events`** (plural), an **array** of event types. It does **not** take `event` (singular). The singular `event` field only ever appears in the response of the list endpoint (`GET /hooks/list`), where each stored webhook maps to exactly one event. - `events` is a **convenience batch**: the operation is applied **once per event in the array**. Internally it creates/updates **one webhook per event**, because webhooks are stored one document per subscribed event. - Correct shape: `{"events": ["es-public-administration:started", "es-public-administration:ended"], "enabled": true, "base_url": "https://example.com/my/hook"}`. </llms-only>

Authentication

X-APP-SECRETstring
Application Secret

Request

This endpoint expects an object.
eventslist of enumsRequired
The specific flow events type to register or update the webhook callback for.
base_urlstringRequired

The target URL where the webhook callbacks should be sent.

Note: Any query parameters in the URL will be stripped; dynamic query parameters should be defined in the flow session configuration.

enabledbooleanOptionalDefaults to false
Set to true to activate the webhook callback, or false to keep it inactive.

Response

204 No Content
Webhooks configurations updated successfully.

Errors

422
Unprocessable Entity Error