Skip to main content

Setting up Webhooks

To use webhooks, you need to set up a webhook endpoint URL in your application that can receive POST requests from Cobalt. This URL should be publicly accessible and use HTTPS for security. You can set up multiple webhook urls (eg. one for development and one for production) and Cobalt will send the same webhook event to each url.

Register

To register a new webhook, POST /v1/webhook. Example request:
Example response:

Get Configuration

To retrieve your current webhook configuration, GET /v1/webhook. Example request:
Example response:

Remove a Webhook URL

To remove a webhook url, DELETE /v1/webhook/:id. Example request:
Example response:

Rotate Secret

To rotate your webhook secret key, POST /v1/webhook/rotate-secret.
Example response:

Overriding the Destination Per Request

By default, every event is delivered to all of your registered webhook URLs. To route the events for a single operation somewhere else instead, include a callback_urls array in the body of any asynchronous request (the POST and PATCH endpoints that return a job_id):
When callback_urls is provided, the completion event for that operation is delivered only to those URLs and not to your registered account URLs. Omit it and delivery is unchanged. Each URL must use HTTPS.