Skip to main content
POST

Request body

database and collection are the current field names (formerly tenant_id and sub_tenant_id). The old names remain accepted as deprecated aliases for full backward compatibility.

Successful response

Always check if a database is ready before using it. Use Database Status to check.

What happens after database creation?

  1. Create the database with POST /databases
  2. Default collection: No collection exists until your first write. The first time you ingest without an explicit collection, HydraDB creates the database’s default collection, which then stores all context written without a collection. Create additional collections at any time to scope data to users, teams, or projects.
  3. Retry failed databases: If a database appears in data.failed_databases, re-create that database with POST /databases after addressing the reported issue. Poll status again before ingestion.
  4. Start ingesting context once databases are ready
  5. Check status of ingestion. Start querying the database once the recently ingested sources show completed

Defining metadata schema

Schema field names are immutable after database creation. You can add per-document free-form metadata fields at ingestion time, and add new database-level fields later with Update Metadata Schema, but updates are additive only: no delete, rename, type change, or Milvus backfill for newly added dense/sparse metadata lanes. Plan your schema carefully before creating the database.
You can define a custom schema at database creation to enable exact-match metadata filtering (enable_match) or semantic/BM25 search over metadata text fields (enable_dense_embedding / enable_sparse_embedding). For detailed parameters, valid data types, limits, shorthand flags, and comprehensive examples, see the metadata guide.

Authorizations

Authorization
string
header
required

API key sent as a Bearer token: "Bearer prefix.secret"

Body

application/json

Database creation request

database
string

Database is the canonical v2 name; TenantID is its deprecated alias and remains fully accepted. The TenantAliases middleware reconciles them before this binds, so TenantID is always populated.

Example:

"acme_corp"

database_metadata_schema
object[]

Defines database-level metadata fields for exact-match filtering and semantic/BM25 search. Canonical name; tenant_metadata_schema is a deprecated alias. Schema field names are immutable after database creation.

Example:
embeddings_dimension
integer

Override for the embedding vector dimension. Default: 1536.

Example:

1536

is_embeddings_tenant
boolean

Internal flag for embedding-only databases.

Example:

false

tenant_id
string
deprecated

deprecated: use database

Example:

"tenant_1234"

tenant_metadata_schema
object[]
deprecated

deprecated: use database_metadata_schema

Response

OK

data
object
Example:
error
object

Error message, empty string on success.

Example:
meta
object
Example:
success
boolean

Whether the request succeeded.

Example:

true