A valid request URL is required to generate request examples
{ "tenant_id": "tenant_1234", "infra": { "scheduler_status": true, "graph_status": true, "vectorstore_status": [] }, "metadata_schema": { "field_count": 1, "dense_embedding_fields": [], "sparse_embedding_fields": [] }, "message": "Tenant created and infra provisioning triggered"}
Tenant Management
Create Tenant
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 field
enable_dense_embedding: Create dense embeddings for semantic similarity search
enable_sparse_embedding: Create sparse embeddings (BM25) for keyword search
Use this file to discover all available pages before exploring further.
Create a new tenant. If you pass tenant_id as a query parameter, that ID will be used. If not provided, the service generates a new tenant_id and returns it.
Hit the Try it button to try this API now in our playground. It’s the best way to check the full request and response in one place, customize your parameters, and generate ready-to-use code snippets.
Important: When a tenant is created, Cortex automatically creates a DEFAULT sub-tenant that acts as a global space for that tenant. Any documents ingested or API calls made with the tenant_id but without specifying a sub_tenant_id will automatically reference this default sub-tenant.
No Separate API Required: Cortex doesn’t require a separate API call to create additional sub-tenants. Sub-tenants are created automatically when you first use a new sub_tenant_id that doesn’t exist yet.
// Use user IDs as sub-tenant IDs for personal workspacessub_tenant_id: "user_12345"sub_tenant_id: "user_67890"
For B2B Applications (Departments/Teams):
// Use descriptive department or team namessub_tenant_id: "engineering"sub_tenant_id: "sales"sub_tenant_id: "hr"sub_tenant_id: "marketing"
For Project-Based Organizations:
// Use project identifierssub_tenant_id: "project_alpha"sub_tenant_id: "client_acme_corp"
Naming Convention: Use consistent prefixes like user_, dept_, or project_ to make the purpose of each sub-tenant clear. Avoid special characters and keep names descriptive but concise.
Important: Tenant metadata keys are immutable once set during tenant creation. Choose your keys carefully as they cannot be modified later. Document metadata remains fully flexible and can be set per document during upload.
The following keywords are reserved and cannot be used as keys in tenant_metadata_schema:
source_id
source_title
source_url
source_type
source_collection
source_owner
source_collaborator
source_upload_time
source_last_updated_time
chunk_id
chunk_uuid
chunk_content
document_metadata
base_metadata
layout
description
These keywords are used internally by Cortex for document processing and search functionality. Using any of these reserved keywords as tenant metadata keys will result in an error during tenant creation.
Schema: Practice area, client ID, confidentiality level, jurisdiction
Query: “Find all corporate law documents for client ACME that are not confidential”
Filter: practice_area = "corporate_law" AND client_id = "ACME" AND confidentiality_level != "confidential"
Schema: Product line, team, component, priority, tags
Query: “Show me all high-priority API documentation from the backend team”
Filter: product_line = "API" AND team = "backend" AND priority >= 4
Schema: Department, employee type, salary band, status
Query: “Find all active full-time employees in the Engineering department”
Filter: department = "Engineering" AND employee_type = "full_time" AND status = "active"
Schema Immutability: Once you create a tenant with a metadata schema, the keys cannot be changed. However, you can:
Add new fields to document metadata (fully flexible)
Update values for existing tenant metadata fields
Create new sub-tenants with different schemas if needed
Note:
The tenant_metadata_schema field 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.
Returns the final tenant_id and a confirmation message
Note: 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 sets sub_tenant_id = tenant_id and prepares the tenant for embeddings-first workloads.
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.