POST to your server when something happens, so you do not have to keep asking. Creating one needs the webhooks:write permission.
Events
| Event | When | data holds | The key also needs |
|---|---|---|---|
agent_task.finished | An agent task succeeded, failed or was cancelled | The task, as GET /v1/agent-tasks/{id} returns it | agent:read |
deployment.succeeded | A deployment finished and the app is live | The deployment | deploy:read |
deployment.failed | A deployment failed | The deployment, with its error | deploy:read |
automation_run.finished | An automation run finished | The run | automations:read |
balance.low | The balance dropped below the threshold | total and threshold | account:read |
balance.low is checked every five minutes and sent once each time the balance drops below the threshold, 100 credits unless you set balance_below.
Create a webhook
secret. Store it: you need it to check signatures. GET /v1/webhooks/{id} shows it again.
The address must be public https. It is resolved and checked on every delivery, and redirects are not followed.
A webhook belongs to the key that created it. When that key is revoked or expires, the webhook stops. A key limited to apps or workspaces only hears about those.
What a delivery looks like
2xx within a few seconds and do the work afterwards. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours, then marked failed. GET /v1/webhooks/{id}/deliveries shows recent attempts.
The event id stays the same across retries, so keep the ids you have handled and skip repeats.
Check the signature
X-Jobbit-Signature is sha256= followed by the hex HMAC-SHA256 of <X-Jobbit-Timestamp>.<raw body>, keyed with the webhook’s secret. Compute it over the raw bytes you received, before parsing the JSON, and reject deliveries whose timestamp is more than five minutes old.
Other ways to follow work
- Server-sent events.
GET /v1/agent-tasks/{id}/eventsstreams a task’s status changes and its result while you hold the connection. - Polling.
GET /v1/agent-tasks/{id}andGET /v1/deployments/{id}return the current state.