Skip to main content

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 one Authorization header:
Also send API-Version: 2 on raw HTTP requests. The official SDKs set the version header automatically.

Database not found after creation

Database creation is asynchronous. After POST /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_metadata length does not match the documents array length.
  • app_knowledge, memories, or document_metadata was sent as an object instead of a JSON-stringified multipart field.
  • A memory item has neither text nor user_assistant_pairs.
  • A typed tenant_metadata value does not match the database metadata schema.

Empty query results

Empty results are not always errors. Check these first:
  • Context status may still be queued or processing; poll GET /context/status.
  • metadata_filters may be too restrictive or may target the wrong metadata namespace.
  • The query may be scoped to the wrong database or collection (formerly tenant_id / sub_tenant_id).
  • The type value may exclude the collection you need. Use type: "all" when combining knowledge and memories in POST /query.