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 aswebhooks.listDeliveries.
Set up the webhook:
Track deliveries:
Manage signing or delete the webhook:
Typical call sequence
POST /webhooks/indexingwith your HTTPS endpoint andgenerate_signing_secret: true. Store the signing secret it returns. Your endpoint must be reachable over public HTTPS; localhost and private network addresses are rejected.POST /webhooks/indexing/testto check your receiver accepts the delivery and verifies the signature.- Ingest content as usual. Each item that finishes indexing produces one delivery.
GET /webhooks/indexing/deliveries?status=permanently_failedto find deliveries that ran out of retries, then retry them once the problem is fixed. Afaileddelivery is still being retried automatically.
Delivery and retries
- Each delivery contains the event body and an
X-HydraDB-Delivery-IDheader. Signed deliveries also includeX-HydraDB-Signature; see Verify the signature. - Failed deliveries retry with exponential backoff. HydraDB Cloud marks a delivery
permanently_failedafter 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 aPOST with a JSON body and these headers:
Delivery payloads for completed, errored, and test events: JSON
Delivery payloads for completed, errored, and test events: JSON
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 carriesX-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.
Verify with the SDK helper: Python or TypeScript
Verify with the SDK helper: Python or TypeScript
== leaks timing information that can be used to forge a signature byte by byte.
Verify without the SDK: Python or TypeScript
Verify without the SDK: Python or TypeScript
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.
Receiver examples: Python (FastAPI) or TypeScript (Express)
Receiver examples: Python (FastAPI) or TypeScript (Express)
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.
Generate, supply, or disable the signing secret: cURL
Generate, supply, or disable the signing secret: cURL
X-HydraDB-Signature.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.
A receiver that accepts either secret: Python or TypeScript
A receiver that accepts either secret: Python or TypeScript
Related resources
- Ingestion Status: polling instead of a webhook
- Ingest Context: the ingestion that produces deliveries
