Create webhook

Registers a URL that receives task events as they happen, so you do not have to poll. Deliveries are signed (Standard Webhooks); the signing secret is returned here and nowhere else.

POST/webhooks
AuthAPI keyorOAuth tokenHow to send it

Request body

enabledboolean

Whether the webhook is enabled. When disabled, no events will be sent to the webhook.

default true
urlstringrequired

Receives the events. Must be https and a public host.

e.g. "https://example.com/hooks/mynth"
eventsstring[]required

The events to send. ["all"] sends every event, including ones added later. task.completed and task.failed cover every task type.

≥ 1 items
api_key_idsstring[] | null

Tasks created with these API keys are sent. Omitted or null: every key, including keys created later. An empty list: no key.

≤ 1000 items
include_session_tasksboolean

Also send tasks created without an API key: playground runs and other signed-in (OAuth) sessions. Tasks the CLI creates carry its API key, so api_key_ids decides those.

default false

Response

Webhook created

dataobjectrequired

Errors

A failed call names what went wrong in code, with a sentence in message. The codes, which of them are worth retrying, and how to read a validation failure are on Errors.