Create a tenant for your account.
Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
Tenant Metadata Schema
You can optionally provide a tenant_metadata_schema to define custom fields that will be
indexed in the vector store. Each field can be configured with:
enable_match: Enable text filtering on this fieldenable_dense_embedding: Create dense embeddings for semantic similarity searchenable_sparse_embedding: Create sparse embeddings (BM25) for keyword searchExample Request:
{
"tenant_id": "my-tenant",
"tenant_metadata_schema": [
{
"name": "category",
"data_type": "VARCHAR",
"max_length": 256,
"enable_match": true
},
{
"name": "product_description",
"data_type": "VARCHAR",
"max_length": 4096,
"enable_dense_embedding": true,
"enable_sparse_embedding": true
}
]
}
Expected outcome:
tenant_id as a query parameter, that ID will be used. If not provided, the service generates a new tenant_id and returns it.
tenant_id but without specifying a sub_tenant_id will automatically reference this default sub-tenant.sub_tenant_id that doesn’t exist yet.
sub_tenant_id that doesn’t exist, Cortex automatically creates that sub-tenantsub_tenant_id will create the sub-tenant and then process your contentuser_, dept_, or project_ to make the purpose of each sub-tenant clear. Avoid special characters and keep names descriptive but concise.tenant_metadata_schema:
source_idsource_titlesource_urlsource_typesource_collectionsource_ownersource_collaboratorsource_upload_timesource_last_updated_timechunk_idchunk_uuidchunk_contentdocument_metadatabase_metadatalayoutdescriptiontenant_metadata_schema array should specify:
| Type | Description | Example Values | Use Cases |
|---|---|---|---|
| string | Text data | "Engineering", "SOC2", "confidential" | Categorical data, identifiers, labels |
| number | Numeric values | 5, 100.5, 2024 | Quantitative metrics, versions, priorities |
| boolean | True/false values | true, false | Binary flags, status indicators |
| date | Date/time values | "2024-01-15T10:30:00Z" | Temporal data, audit trails |
| Type | Description | Example Values | Use Cases |
|---|---|---|---|
| object | Structured data | {"city": "SF", "country": "USA"} | Hierarchical relationships, nested data |
| array | Multiple values | ["security", "api", "compliance"] | Multi-value attributes, tags, categories |
searchable and filterable is crucial for optimal metadata design:
1. Searchable Fields
"Which documents are from the Engineering department?"department = "Engineering" AND status = "active"business_unit instead of businessUnitdata_classification_level instead of classificationcompliance_*, security_*, business_*department (searchable: true)compliance_framework (searchable: true)department (filterable: true)data_classification (filterable: true)is_confidential (filterable: true)business_unit = "Product" (filterable: true)practice_area = "corporate_law" AND client_id = "ACME" AND confidentiality_level != "confidential"
product_line = "API" AND team = "backend" AND priority >= 4
department = "Engineering" AND employee_type = "full_time" AND status = "active"
Note:
- The
tenant_metadata_schemafield in the request body is optional but recommended for enterprise setups. It defines immutable tenant-level metadata keys that will apply to all documents in this tenant.- For more detailed information about metadata usage, filtering, and querying, see our Metadata documentation.
tenant_id via querytenant_id if none is providedtenant_id and a confirmation messageNote: If your use case is to directly upload and search embeddings (without document/text ingestion), use the dedicated embeddings-tenant endpoint instead:/embeddings/create_tenant. This setssub_tenant_id = tenant_idand prepares the tenant for embeddings-first workloads.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Request model for creating a tenant with optional metadata schema.
The tenant_metadata_schema allows you to define custom fields that will be indexed in Milvus with configurable search capabilities:
Example: { "tenant_id": "my-tenant", "tenant_metadata_schema": [ { "name": "category", "data_type": "VARCHAR", "max_length": 256, "enable_match": true }, { "name": "product_description", "data_type": "VARCHAR", "max_length": 4096, "enable_dense_embedding": true, "enable_sparse_embedding": true } ] }
Unique tenant identifier
1"tenant_1234"
True to create embeddings tenant
true
Embedding dimensions for embeddings tenant. Not required for non-embeddings (is_embeddings_tenant=False) tenants
Schema definition for tenant metadata fields. Each field can be configured for: filtering (enable_match), semantic search (enable_dense_embedding), and/or keyword search (enable_sparse_embedding). Fields with embeddings enabled must be VARCHAR type.
[
{
"data_type": "VARCHAR",
"enable_match": true,
"max_length": 256,
"name": "category"
},
{
"data_type": "VARCHAR",
"enable_dense_embedding": true,
"enable_sparse_embedding": true,
"max_length": 4096,
"name": "product_description"
}
]Successful Response
Identifier provided by user
"tenant_1234"
Infra status
Summary of configured tenant metadata schema (if provided)
Summary message