webhook = client.webhooks.register(
url="https://example.com/hydradb/webhooks",
event_types=["indexing.status_changed"],
generate_signing_secret=True,
)
secret = webhook.data.signing_secret # returned once; store it now
const webhook = await client.webhooks.register({
url: "https://example.com/hydradb/webhooks",
eventTypes: ["indexing.status_changed"],
generateSigningSecret: true,
});
const secret = webhook.data?.signingSecret; // returned once; store it now
curl -X POST 'https://api.hydradb.com/webhooks/indexing' \
-H "Authorization: Bearer $HYDRADB_API_KEY" \
-H "API-Version: 2" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/hydradb/webhooks",
"event_types": ["indexing.status_changed"],
"generate_signing_secret": true
}'
{
"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": "sub_tenant_4567",
"tenant_id": "tenant_1234",
"warnings": [
{
"code": "acl_ignored_by_connector_enforcement",
"message": "This connector enforces ACL, so the request's acl was ignored."
}
]
},
"success": true
}{
"data": null,
"detail": {
"deprecated": true,
"deprecated_field": "tenant_id",
"deprecated_since": "2.0.1",
"error_code": "VALIDATION_ERROR",
"message": "Request validation failed",
"preferred_field": "database",
"retry_after_seconds": 1,
"retryable": true
},
"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 replace the indexing webhook for your organization.
webhook = client.webhooks.register(
url="https://example.com/hydradb/webhooks",
event_types=["indexing.status_changed"],
generate_signing_secret=True,
)
secret = webhook.data.signing_secret # returned once; store it now
const webhook = await client.webhooks.register({
url: "https://example.com/hydradb/webhooks",
eventTypes: ["indexing.status_changed"],
generateSigningSecret: true,
});
const secret = webhook.data?.signingSecret; // returned once; store it now
curl -X POST 'https://api.hydradb.com/webhooks/indexing' \
-H "Authorization: Bearer $HYDRADB_API_KEY" \
-H "API-Version: 2" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/hydradb/webhooks",
"event_types": ["indexing.status_changed"],
"generate_signing_secret": true
}'
{
"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": "sub_tenant_4567",
"tenant_id": "tenant_1234",
"warnings": [
{
"code": "acl_ignored_by_connector_enforcement",
"message": "This connector enforces ACL, so the request's acl was ignored."
}
]
},
"success": true
}{
"data": null,
"detail": {
"deprecated": true,
"deprecated_field": "tenant_id",
"deprecated_since": "2.0.1",
"error_code": "VALIDATION_ERROR",
"message": "Request validation failed",
"preferred_field": "database",
"retry_after_seconds": 1,
"retryable": true
},
"error": {
"code": "DATABASE_NOT_FOUND",
"message": "Database not found"
},
"meta": {
"latency_ms": 12.3,
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d"
},
"success": false
}webhook = client.webhooks.register(
url="https://example.com/hydradb/webhooks",
event_types=["indexing.status_changed"],
generate_signing_secret=True,
)
secret = webhook.data.signing_secret # returned once; store it now
const webhook = await client.webhooks.register({
url: "https://example.com/hydradb/webhooks",
eventTypes: ["indexing.status_changed"],
generateSigningSecret: true,
});
const secret = webhook.data?.signingSecret; // returned once; store it now
curl -X POST 'https://api.hydradb.com/webhooks/indexing' \
-H "Authorization: Bearer $HYDRADB_API_KEY" \
-H "API-Version: 2" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/hydradb/webhooks",
"event_types": ["indexing.status_changed"],
"generate_signing_secret": true
}'
generate_signing_secret: true. The signing secret comes back once, in this response, and cannot be read again. Send generate_signing_secret or signing_secret, not both.
Omitting signing_secret preserves any signing secret you already have. Editing the URL or the event list never changes your signing configuration. To disable signing, call Disable Signing explicitly. See Manage the signing secret.
Your endpoint must be reachable over public HTTPS. Localhost and private network addresses are rejected. See Webhooks for the payload format, retry behavior, and receiver examples.Authorizations
Send your API key as Authorization: Bearer <your_api_key>.
Body
Webhook registration request
Event types to subscribe to (e.g. ["indexing.status_changed"]).
["indexing.status_changed"]
Generate a signing secret in this request. It is returned once and cannot be retrieved later. Cannot be combined with signing_secret.
true
Secret, at least 16 characters, that signs deliveries: X-HydraDB-Signature: sha256=<hex> is the HMAC-SHA256 of the raw body. Omit it to keep any existing 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"
}
Error details on failure, or null on success.
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": "sub_tenant_4567",
"tenant_id": "tenant_1234",
"warnings": [
{
"code": "acl_ignored_by_connector_enforcement",
"message": "This connector enforces ACL, so the request's acl was ignored."
}
]
}
Whether the request succeeded.
true
Was this page helpful?
