Skip to main content
A webhook is an HTTP POST that HydraDB sends to your endpoint when ingested content reaches a terminal indexing state, completed or errored, so you do not have to poll Ingestion Status. One webhook is registered per organization, for the indexing.status_changed event. Verify the signature shows how your receiver checks that a delivery came from HydraDB.

Endpoint references

SDK methods are listed by their Python names. The TypeScript SDK uses the same names in camelCase, such as webhooks.listDeliveries. Set up the webhook: Track deliveries: Manage signing or delete the webhook:

Typical call sequence

  1. POST /webhooks/indexing with your HTTPS endpoint and generate_signing_secret: true. Store the signing secret it returns. Your endpoint must be reachable over public HTTPS; localhost and private network addresses are rejected.
  2. POST /webhooks/indexing/test to check your receiver accepts the delivery and verifies the signature.
  3. Ingest content as usual. Each item that finishes indexing produces one delivery.
  4. GET /webhooks/indexing/deliveries?status=permanently_failed to find deliveries that ran out of retries, then retry them once the problem is fixed. A failed delivery is still being retried automatically.

Delivery and retries

  • Each delivery contains the event body and an X-HydraDB-Delivery-ID header. Signed deliveries also include X-HydraDB-Signature; see Verify the signature.
  • Failed deliveries retry with exponential backoff. HydraDB Cloud marks a delivery permanently_failed after 16 attempts or 48 hours after the first failure, whichever comes first.
  • Automatic and manual retries use your current signing secret.
  • Test deliveries do not appear in the delivery history.

Read the payload you receive

Each delivery is a POST with a JSON body and these headers:
A test delivery is synthetic: nothing was ingested, so there is no database name to report, and every scope field, including database, is set to your organization ID. Match on test: true (or the test_ prefix on delivery_id) to tell it apart from a real delivery.
Route and filter on database, not tenant_id; database is the name you sent. New integrations should read database and collection.

Verify the signature

When signing is configured, every delivery carries X-HydraDB-Signature: sha256=<lowercase hex digest>, where the digest is HMAC-SHA256 with your signing secret as the key over the raw request body bytes. Three details decide whether your verifier works:
  • The sha256= prefix is part of the header value, not a separate field. Compare against the whole string.
  • The digest is lowercase hex, not base64.
  • The HMAC is computed over the raw body bytes exactly as received. Parsing the JSON and re-serializing it produces different bytes, so the signature will not match.
The official SDKs include a verifier:
Otherwise, implement it directly. Both versions use a constant-time comparison, which matters: a naive == leaks timing information that can be used to forge a signature byte by byte.
If the signing secret is missing from your environment, reject the request rather than skipping verification. Return a 2xx quickly and do slow work after acknowledging the request. These receivers wire the verifier into a handler; both read the raw body before parsing.

Manage the signing secret

POST /webhooks/indexing/signing-secret enables or rotates signing after registration, and DELETE on the same path disables it. Two ways to set a secret:
  • Let HydraDB generate one: send no body. The secret is returned exactly once, in plain text, and takes effect immediately.
  • Supply your own: send signing_secret, at least 16 characters. Use this to deploy the secret to your receiver before HydraDB starts signing with it, as in Rotate without downtime.
Disabling removes the stored secret, and deliveries stop carrying X-HydraDB-Signature.
Rotating takes effect immediately, with no overlap period. Deliveries in flight during a rotation are signed with the new secret, so a receiver that only knows the old one will reject them. Rotate without downtime shows how to avoid the gap.

Rotate without downtime

HydraDB signs each delivery with one secret, so the overlap has to live in your receiver: deploy it with both secrets before rotating in HydraDB, and supply the new secret yourself so you know it before it takes effect.
1

Choose the new secret yourself

Generate a high-entropy value with your own tooling, for example openssl rand -base64 32. Do not use the generate option here: a generated secret is only revealed after it is already in effect, which is the window you are trying to avoid.
2

Teach your receiver both secrets

Deploy your receiver so it accepts either the current secret or the new one, reading both from your environment. At this point nothing has changed on the HydraDB side, so every delivery still verifies against the old secret.
3

Rotate in HydraDB, supplying that secret

In the dashboard, open Rotate, tick I’ll use my own secret, and paste the value. Over the API, call POST /webhooks/indexing/signing-secret with a signing_secret body. Deliveries switch to the new secret immediately, and your receiver already accepts it.
4

Retire the old secret

Once you have confirmed deliveries are verifying against the new secret, remove the old one from your receiver and redeploy. You are back to a single active secret.