Webhooks
POST https://api.beatapi.io/v1/webhooks
Create a webhook endpoint for optional BeatAPI task completion callbacks.
Authorization
Authorization string required
Send your BeatAPI API key as a Bearer token. Create one on the Dashboard.
Keep permanent API keys on trusted servers. Content-Type: application/json is required for the request body. Idempotency-Key is optional when the endpoint exposes it and is recommended for safe retries with the exact same body.
Request body
url string required
Public HTTPS callback URL that accepts BeatAPI task events. Do not use localhost or a private-network URL.
Format: uri
description string optional
Optional internal label for identifying the endpoint in your account.
events string[] optional
Task events to deliver. Omit to subscribe to both task.succeeded and task.failed.
Response
A successful request returns HTTP 201.
Events
BeatAPI sends one event when a task reaches a final state. There are two event types, task.succeeded and task.failed. An endpoint receives both unless its events list names only one.
The event body has four fields: id (the event ID, evt_ followed by random characters), event, created_at (Unix seconds) and data. data is the task object, identical to the data that GET /v1/tasks/{task_id} returns for the finished task, so one parser handles both.
task.succeeded
task.failed
Headers
Delivery, retries and duplicates
- Endpoint requirements. The
urlmust be public HTTPS. BeatAPI does not follow redirects, so a3xxanswer counts as a failed attempt. - Acknowledge fast. Answer with any
2xxwithin 10 seconds. A slower answer is a timeout and counts as a failed attempt. Queue the work and process it afterwards. - Retries. A delivery is attempted at most 3 times in total: right after the task finishes, again about 1 minute later, and a last time about 5 minutes after that. Timeouts, network errors,
3xx,429and5xxanswers are retried. Any other4xxanswer is not retried, so return a2xxfor an event you have already handled, and a4xxonly for a request you reject. After the third failure the event is dropped. - Duplicates are possible. The same event can arrive more than once, for example when your server processes it but answers too late. A retry carries the same event
idand body. Deduplicate by eventid(or bydata.idandevent) before you act on it. - Order is not guaranteed. Use
data.statusanddata.completed_atrather than arrival order. - Disabled endpoints. An endpoint whose
statusisdisabledreceives nothing. - Failures BeatAPI ends itself. A task still unfinished after the processing window (at most 24 hours) is failed with
error_code: processing_timeoutand sendstask.failedlike any other failure. A task whose dispatch never completed, and a task whose channel could not be read, also fail and sendtask.failed. Readusagein the event for what was charged.
When no event is sent
Webhooks are a convenience; polling GET /v1/tasks/{task_id} is the source of truth. Keep a slow reconciliation poll for tasks that stay queued or processing for much longer than usual. No event is sent in these cases.
- Data tasks. A data capability run as a task (web research) is polled; it sends no event.
- Intermediate statuses. There is no event for
queued,processingor the Music Video review states. - A result that cannot be resolved. If the finished task’s files cannot be listed when the event is built, the event is skipped; the poll still answers correctly.
One-off callback
A request to POST /v1/images/tasks or POST /v1/videos/tasks can carry an optional callback_url. When that task succeeds or fails, BeatAPI sends the event to this address as well as to your account endpoints. It is meant for a caller that wants the result of one task delivered to one place without a global subscription.
- Register an endpoint first. BeatAPI has no separate signing key for callbacks. The
callback_urlmust have the same scheme, host and port as one of your enabled webhook endpoints, and that endpoint’ssecretsigns the delivery, so verify it as described under Verify callback signatures. The path may differ from the endpoint’s. - Address rules. Public HTTPS only, at most 2048 characters. A private, loopback or link-local address is refused, and BeatAPI does not follow redirects.
- Both outcomes.
task.succeededandtask.failedare both sent, whatever events the signing endpoint subscribes to. The event body, headers, timeout and retry rules are the same as for an account endpoint. - Alongside your endpoints. An account endpoint subscribed to the event receives it too. When the
callback_urlis exactly that endpoint’s URL, the event is sent once. - When it stops. If the signing endpoint is deleted, disabled, or changed to another host, the callback is void: nothing is sent, and a retry still pending is dropped.
- Not accepted elsewhere. Workflows, Effects and Capabilities Run do not take
callback_url.
A callback_url that cannot be used is 400 bad_request and no task is created. The message names the field:
Verify callback signatures
BeatAPI sends x-beatapi-event, x-beatapi-timestamp, and x-beatapi-signature with every delivery. Compute the expected hex HMAC-SHA256 value over:
timestamp + "." + raw_request_body
Use the endpoint secret returned by the create request (the whole string, including whsec_). It is shown once, so store it when you create the endpoint. Compare signatures in constant time, verify the exact raw bytes before JSON parsing, and reject timestamps older than 5 minutes to limit replay attacks.
Node.js (Express)
Python (Flask)
Manage endpoints
GET /v1/webhookslists webhook endpoints.GET /v1/webhooks/{id}gets a webhook endpoint.PATCH /v1/webhooks/{id}updates a webhook endpoint. It acceptsurl,description,eventsandstatus(activeordisabled).DELETE /v1/webhooks/{id}deletes a webhook endpoint.
Next step
Verify every callback signature before parsing its payload. Polling GET /v1/tasks/{task_id} remains the source of truth if delivery is delayed or fails.

