import requests
url = "https://api.hydradb.com/webhooks/indexing"
payload = {
"event_types": ["indexing.status_changed"],
"generate_signing_secret": True,
"signing_secret": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
"url": "https://docs.hydradb.com/phoenix"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_types: ['indexing.status_changed'],
generate_signing_secret: true,
signing_secret: 'whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY',
url: 'https://docs.hydradb.com/phoenix'
})
};
fetch('https://api.hydradb.com/webhooks/indexing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.hydradb.com/webhooks/indexing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_types": [
"indexing.status_changed"
],
"generate_signing_secret": true,
"signing_secret": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
"url": "https://docs.hydradb.com/phoenix"
}
'{
"data": {
"event_types": [
"indexing.status_changed"
],
"message": "Success",
"registered": true,
"signing_secret": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
"signing_secret_configured": true,
"url": "https://docs.hydradb.com/phoenix"
},
"error": null,
"meta": {
"collection": "team_docs",
"database": "acme_corp",
"latency_ms": 12.3,
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"source_type": "file",
"sub_tenant_id": "team_docs",
"tenant_id": "acme_corp"
},
"success": true
}{
"data": "<unknown>",
"detail": {
"deprecated": true,
"deprecated_field": "tenant_id",
"error_code": "VALIDATION_ERROR",
"message": "Request validation failed",
"preferred_field": "database"
},
"error": {
"code": "DATABASE_NOT_FOUND",
"message": "Database not found"
},
"meta": {
"latency_ms": 12.3,
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d"
},
"success": false
}Register Webhook
Register or update the indexing webhook for your workspace.
import requests
url = "https://api.hydradb.com/webhooks/indexing"
payload = {
"event_types": ["indexing.status_changed"],
"generate_signing_secret": True,
"signing_secret": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
"url": "https://docs.hydradb.com/phoenix"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_types: ['indexing.status_changed'],
generate_signing_secret: true,
signing_secret: 'whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY',
url: 'https://docs.hydradb.com/phoenix'
})
};
fetch('https://api.hydradb.com/webhooks/indexing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.hydradb.com/webhooks/indexing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_types": [
"indexing.status_changed"
],
"generate_signing_secret": true,
"signing_secret": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
"url": "https://docs.hydradb.com/phoenix"
}
'{
"data": {
"event_types": [
"indexing.status_changed"
],
"message": "Success",
"registered": true,
"signing_secret": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
"signing_secret_configured": true,
"url": "https://docs.hydradb.com/phoenix"
},
"error": null,
"meta": {
"collection": "team_docs",
"database": "acme_corp",
"latency_ms": 12.3,
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"source_type": "file",
"sub_tenant_id": "team_docs",
"tenant_id": "acme_corp"
},
"success": true
}{
"data": "<unknown>",
"detail": {
"deprecated": true,
"deprecated_field": "tenant_id",
"error_code": "VALIDATION_ERROR",
"message": "Request validation failed",
"preferred_field": "database"
},
"error": {
"code": "DATABASE_NOT_FOUND",
"message": "Database not found"
},
"meta": {
"latency_ms": 12.3,
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d"
},
"success": false
}signing_secret preserves any secret you already have. Editing the URL or the event list never changes your signing configuration. To disable signing, call DELETE /webhooks/indexing/signing-secret explicitly. See Manage the signing secret.generate_signing_secret: true. The secret comes back once, in this response, and cannot be read again. Send generate_signing_secret or signing_secret, not both.
Your endpoint must be reachable over public HTTPS. Localhost and private network addresses are rejected. See Webhooks for the payload format, retry behaviour, and receiver examples.Authorizations
API key sent as a Bearer token: "Bearer prefix.secret"
Body
Webhook registration request
Event types to subscribe to (e.g. ["indexing.status_changed"]).
["indexing.status_changed"]
Generate a signing secret as part of this request, so registering and enabling signing are one atomic operation. The secret is returned once on the response and cannot be retrieved later. Mutually exclusive with signing_secret.
true
Secret used to sign webhook payloads. Deliveries carry X-HydraDB-Signature: sha256=<hex>, the HMAC-SHA256 of the raw request body keyed by this secret. Minimum 16 characters when you supply your own; omit it and one is generated for you. On registration, omitting this field preserves any existing secret - to disable signing, call DELETE /webhooks/indexing/signing-secret.
"whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY"
Endpoint URL to deliver webhook events to.
"https://docs.hydradb.com/phoenix"
Response
Created
Show child attributes
Show child attributes
{
"event_types": ["indexing.status_changed"],
"message": "Success",
"registered": true,
"signing_secret": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
"signing_secret_configured": true,
"url": "https://docs.hydradb.com/phoenix"
}
Null on success; an object with code and message on failure.
Show child attributes
Show child attributes
null
Show child attributes
Show child attributes
{
"collection": "team_docs",
"database": "acme_corp",
"latency_ms": 12.3,
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"source_type": "file",
"sub_tenant_id": "team_docs",
"tenant_id": "acme_corp"
}
Whether the request succeeded.
true
Was this page helpful?
