POST to your endpoint when an asynchronous
operation, such as a backup or restore, reaches a final status.
- These routes require a full-account API key. A selected-database key
receives
403 KEY_SCOPE_DENIED. See API keys. - API access requires a Pro or Business plan.
Events
Each event name is<operation type>.<final status>:
Handle unknown event names gracefully; new operation types can add events.
Events are sent only for final statuses, not for
queued or running. An
endpoint registered without databaseId receives events for every database in
the account. An endpoint registered with databaseId receives events for that
database only.
Payload
id and data.operationId are the operation ID. Read the full operation,
including its result, with Get operation.
For a failed operation, error is {"code": "...", "message": "..."}.
Request headers
Verify the signature
DBHost signs each attempt with your endpoint’s signing secret:- Build the signed string: the
DBHost-Timestampvalue, a., then the raw request body exactly as received. - Compute HMAC-SHA256 over that string. Use the full secret, including the
whsec_prefix, as the key. - Hex-encode the digest, prefix it with
v1=, and compare it toDBHost-Signaturein constant time.
Delivery and retries
- A
2xxresponse within 10 seconds counts as delivered. Redirects are not followed and count as a failure. - A failed delivery is retried up to five attempts in total, with growing delays (about 30 seconds, then 1, 2 and 4 minutes, plus jitter).
- A successful delivery resets the endpoint’s
consecutiveFailuresto0. - After a delivery has used all attempts, DBHost disables the endpoint if it
has 10 or more consecutive failed attempts. Its
enabledbecomesfalseanddisabledAtis set. Rotating the secret enables it again.
Endpoint URL rules
- The URL must be an absolute
https://URL without a username or password. localhost,*.localhost,*.localand*.internalhostnames are rejected.- The hostname must resolve, and every address must be public. Private, loopback, link-local, carrier-grade NAT, multicast and documentation ranges are rejected. DBHost checks this again on every delivery.
- Any
#fragmentis removed.
List endpoints
GET /api/v1/webhooks
200 OK
Create an endpoint
POST /api/v1/webhooks
201 Created
Rotate the signing secret
POST /api/v1/webhooks/{id}/rotate
Creates a new signing secret. The old secret stops being used immediately,
including for retries of earlier events. Rotating also re-enables a disabled
endpoint and resets consecutiveFailures to 0. No request body is needed.
200 OK
Disable an endpoint
DELETE /api/v1/webhooks/{id}
Disables the endpoint: it stops receiving events, enabled becomes false
and disabledAt is set. The endpoint stays in the list. Returns
204 No Content with an empty body. To enable it again, rotate its secret.
Errors
The CLI equivalents are
dbhost webhooks list,
dbhost webhooks create <https-url> [database-id] and
dbhost webhooks rotate|disable <webhook-id>. API keys are managed in
API keys; see also
Authentication.