Authorization: Bearer <your_api_key> and API-Version: 2 against https://api.hydradb.com; the SDKs set both for you. If you are making your first call, follow the Quickstart. AI agents can start from the Agent Integration Guide and the v2 OpenAPI spec. Context means the documents, passages, and memories your model uses to answer a question; HydraDB stores and retrieves them, while your model writes the answer.
The four calls
Most integrations are these four requests, in this order. Everything else in this reference manages what they create.- Create Database:
POST /databases. One isolated workspace per customer, environment, or product. Creation runs in the background, so poll Database Status untilready_for_ingestionistrue. - Ingest Context:
POST /context/ingest. Files, app sources, or memories, in one multipart request. - Ingestion Status:
GET /context/status. Poll the returned ids untilindexing_statusiscompleted, or register a webhook instead. - Query:
POST /query. Retrieve the context your model needs, from knowledge, memories, or both.
Endpoint groups
Core concepts
SDKs
HydraDB publishes official SDKs for Python and TypeScript/Node. They wrap every endpoint in this reference with typed methods and IDE autocomplete.
Quick init:
client.<group>.<method>() maps to the corresponding endpoint. The SDKs are generated from the OpenAPI contract and set API-Version: 2 automatically. The SDK method names below are the Python names; TypeScript camelCases multi-word names (for example, delete_collection is deleteCollection).
Full endpoint inventory
Conventions
Authentication: Every endpoint requiresAuthorization: Bearer <your_api_key> in the request header. Get your key at app.hydradb.com.
Versioning: Send API-Version: 2 with every request.
/databases, /context/*, /query, /feedback, and /webhooks/indexing*) return a consistent envelope. Endpoint pages show the full envelope; the resource-specific payload lives under data. Connector endpoints (/connectors*) and PATCH /databases/{database}/metadata-schema are the exception: they return their success body without the envelope.
success: false, data: null, and an error object containing code and message.
meta may also include a deprecation list when a request uses a legacy /tenants route or a deprecated field (tenant_id/sub_tenant_id, or sub_tenant_ids on /query); each entry carries deprecated, a message, and deprecated_since (field-level notices also add deprecated_field and preferred_field). It is a non-breaking migration nudge (the status code is unchanged) and is accompanied by a Deprecation: true response header. See Migrating from tenant_id and sub_tenant_id.
-
Database scoping: Most database-scoped endpoints require a
database(formerlytenant_id). Many source and query endpoints also accept an optionalcollection(formerlysub_tenant_id) for finer-grained scoping. If omitted, the default collection is used. The oldtenant_id/sub_tenant_idnames (and the old/tenantsroutes) remain accepted as deprecated aliases; sending a canonical name and its alias with different values returns400. See Migrating fromtenant_idandsub_tenant_id. - Async operations: Database creation, database and collection deletion, and content ingestion are asynchronous. They return immediately after queuing. Use the relevant status endpoint to confirm completion before downstream operations.
-
Pagination: Listing endpoints (
/context/list) return pagination fields for browsing large result sets. -
Parameter casing: The REST API uses snake_case (
database,max_results). The TypeScript SDK uses camelCase keys and method names (maxResults,deleteCollection) and ignores request keys it does not recognize, including snake_case ones. The Python SDK uses snake_case throughout. See SDKs. -
Query modes:
POST /querysupportsquery_by: "hybrid"or"text"andtype: "knowledge","memory", or"all". The sametypeenum is used across ingestion, listing, deletion, and query; query additionally accepts"all".
200 (or 202 for async accepts). Errors follow standard HTTP semantics:
See Error Responses for response shapes, error codes, and retry patterns.
Rate limits
Rate limits apply per API key. For production deployments, build retry logic with exponential backoff against the429 response. Contact founders@hydradb.com for current limit values.
Next steps
Existing v1 endpoints remain available under the v1 API Reference.- Build something: Quickstart walks through your first integration in five minutes
- Understand the model: Core Concepts explains databases, collections, content categories, and query results
- Go deeper: Usage covers each primitive in depth
- Install an SDK: Python · TypeScript
