Skip to main content
DBHost can send an HTTPS 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:
  1. Build the signed string: the DBHost-Timestamp value, a ., then the raw request body exactly as received.
  2. Compute HMAC-SHA256 over that string. Use the full secret, including the whsec_ prefix, as the key.
  3. Hex-encode the digest, prefix it with v1=, and compare it to DBHost-Signature in constant time.
Verify against the raw body before parsing JSON. DBHost does not enforce a timestamp window; reject timestamps that are too old for your needs (for example more than five minutes) to limit replay.

Delivery and retries

  • A 2xx response 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 consecutiveFailures to 0.
  • After a delivery has used all attempts, DBHost disables the endpoint if it has 10 or more consecutive failed attempts. Its enabled becomes false and disabledAt is 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, *.local and *.internal hostnames 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 #fragment is removed.

List endpoints

GET /api/v1/webhooks
200 OK
The list includes disabled endpoints. The signing secret is never returned here.

Create an endpoint

POST /api/v1/webhooks
201 Created
secret is shown only in this response and in the rotate response. Store it securely; DBHost cannot show it again.

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.