Response envelope
HydraDB core endpoints (/databases, /context/*, and /query) use the same top-level envelope for successful and failed requests. Webhook management endpoints (/webhooks/indexing*) return their documented response object directly and do not include this envelope.
Use
error.code for branching and log meta.request_id for every failed request. The HTTP status tells you the class of failure; the error code tells you what to do.HTTP status codes
Common error codes
Endpoint pages list the most common codes for that operation. New codes may be added over time, so clients should handle unknown
error.code values gracefully.Legacy routes preserve their original codes. The deprecated
/tenants routes keep the pre-rename error contract for backward compatibility: a missing database returns the generic NOT_FOUND (not DATABASE_NOT_FOUND) and a duplicate on POST /tenants returns INVALID_INPUT (not DATABASE_ALREADY_EXISTS). The canonical /databases routes return the specific DATABASE_NOT_FOUND / DATABASE_ALREADY_EXISTS codes shown above. The HTTP status is identical on both. See Migrating from tenant_id and sub_tenant_id.Retry pattern
Retry only transient failures:429, 500, and 503. Use exponential backoff with jitter and keep retries bounded.
Handling errors
Troubleshooting
Authentication failures
Send exactly oneAuthorization header:
API-Version: 2 on raw HTTP requests. The official SDKs set the version header automatically.
Database not found after creation
Database creation is asynchronous. AfterPOST /databases, poll GET /databases/status until infra.scheduler_status, infra.graph_status, infra.vectorstore_status.knowledge, and infra.vectorstore_status.memories are all true.
Ingestion validation errors
Common causes:document_metadatalength does not match thedocumentsarray length.app_knowledge,memories, ordocument_metadatawas sent as an object instead of a JSON-stringified multipart field.- A memory item has neither
textnoruser_assistant_pairs. - A typed
tenant_metadatavalue does not match the database metadata schema.
Empty query results
Empty results are not always errors. Check these first:- Context status may still be
queuedorprocessing; pollGET /context/status. metadata_filtersmay be too restrictive or may target the wrong metadata namespace.- The query may be scoped to the wrong
databaseorcollection(formerlytenant_id/sub_tenant_id). - The
typevalue may exclude the collection you need. Usetype: "all"when combining knowledge and memories inPOST /query.
Related sections
- API Reference - endpoint inventory and conventions
- Ingestion Status - async ingestion state
- Query - retrieval parameters and response shape