> ## Documentation Index
> Fetch the complete documentation index at: https://cortex-ad5578da.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 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

**Example Request:**
```json
{
    "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:
- A tenant is created and returned with its identifier.
- If tenant_metadata_schema is provided, the vector store collection will include
  the specified custom fields with their configured search capabilities.
- If the tenant already exists, you receive a success message with the existing identifier.

export const TableOfContents = ({title = 'On this page', items, minHeadingLevel = 2, maxHeadingLevel = 3, className = '', activeClassName = 'text-primary dark:text-primary-light border-primary dark:border-primary-light hover:border-primary dark:hover:border-primary-light', inactiveClassName = 'hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300'}) => {
  const [toc, setToc] = useState(items ?? []);
  const [activeId, setActiveId] = useState('');
  useEffect(() => {
    if (items && items.length) return;
    if (typeof document === 'undefined') return;
    const selectors = [];
    for (let lvl = minHeadingLevel; lvl <= maxHeadingLevel; lvl++) {
      selectors.push(`h${lvl}`);
    }
    const nodes = Array.from(document.querySelectorAll(selectors.join(','))).filter(el => el.id);
    const built = [];
    let currentTop = null;
    nodes.forEach(el => {
      const level = Number(el.tagName.slice(1));
      const node = {
        id: el.id,
        label: el.textContent.trim(),
        href: `#${el.id}`,
        children: []
      };
      if (level === minHeadingLevel) {
        built.push(node);
        currentTop = node;
      } else if (level > minHeadingLevel && currentTop) {
        currentTop.children.push(node);
      } else {
        built.push(node);
      }
    });
    setToc(built);
  }, [items, minHeadingLevel, maxHeadingLevel]);
  useEffect(() => {
    if (typeof document === 'undefined') return;
    const applyHash = () => {
      const h = window.location.hash.replace('#', '');
      if (h) setActiveId(h);
    };
    applyHash();
    const observer = new IntersectionObserver(entries => {
      entries.forEach(entry => {
        if (entry.isIntersecting) {
          setActiveId(entry.target.id);
        }
      });
    }, {
      rootMargin: '0px 0px -70% 0px',
      threshold: 0.1
    });
    const ids = toc.flatMap(i => [i, ...i.children ?? []]).map(i => i.id);
    ids.forEach(id => {
      const el = document.getElementById(id);
      if (el) observer.observe(el);
    });
    window.addEventListener('hashchange', applyHash);
    return () => {
      window.removeEventListener('hashchange', applyHash);
      observer.disconnect();
    };
  }, [toc]);
  const Item = ({node, depth = 0}) => {
    const isActive = activeId === node.id;
    return <li className="toc-item relative ml-6" data-depth={depth}>
        <a href={node.href} className={`py-1 block font-medium ${isActive ? activeClassName : inactiveClassName}`} style={depth > 0 ? {
      marginLeft: `${depth}rem`
    } : {}} onClick={() => setActiveId(node.id)}>
          {node.label}
        </a>
        {node.children && node.children.length > 0 && <>
            {node.children.map(child => <Item node={child} depth={depth + 1} key={child.href} />)}
          </>}
      </li>;
  };
  const data = toc && toc.length ? toc : items || [];
  return <div className={`text-gray-600 text-sm leading-6 w-[18rem] pb-4 -mt-10 pt-10 hidden xl:block ${className}`} id="table-of-contents-custom">
      <ul id="table-of-contents-custom-content" className="toc">
        <li className="toc-item relative">
          <div className="text-gray-700 dark:text-gray-300 font-medium flex items-center space-x-2 py-1">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" xmlns="http://www.w3.org/2000/svg" className="h-3 w-3">
              <path d="M2.44434 12.6665H13.5554" strokeLinecap="round" strokeLinejoin="round"></path>
              <path d="M2.44434 3.3335H13.5554" strokeLinecap="round" strokeLinejoin="round"></path>
              <path d="M2.44434 8H7.33323" strokeLinecap="round" strokeLinejoin="round"></path>
            </svg>
            <span>{title}</span>
          </div>
        </li>
        {data.map(node => <Item node={node} key={node.href} />)}
      </ul>
    </div>;
};

<Panel>
  <TableOfContents />
</Panel>

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.

<Tip> 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.</Tip>

### Examples

<Tabs>
  <Tab title="API Request">
    ```bash expandable theme={null}
    curl -X 'POST' \
    'https://api.usecortex.ai/tenants/create' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
    "tenant_id": "string"
    }'
    ```
  </Tab>

  <Tab title="Python (Sync)">
    ```python expandable theme={null}
    # Async usage is similar, just use async_client and await
    tenant_response = client.user.create_tenant(
        tenant_id="tenant_1234",
        tenant_metadata_schema=[
            {
                "key": "department",
                "type": "string",
                "searchable": True,
                "filterable": True
            },
            {
                "key": "compliance_framework",
                "type": "string",
                "searchable": True,
                "filterable": False
            },
            {
                "key": "data_classification",
                "type": "string",
                "searchable": False,
                "filterable": True
            }
        ]
    )
    ```
  </Tab>
</Tabs>

<Note>
  **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.
</Note>

## Creating Additional Sub-Tenants

**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.

### How Sub-Tenant Creation Works

1. **Automatic Creation**: When you upload content with a `sub_tenant_id` that doesn't exist, Cortex automatically creates that sub-tenant
2. **First Upload Triggers Creation**: The first API call with a new `sub_tenant_id` will create the sub-tenant and then process your content
3. **Immediate Availability**: Once created, the sub-tenant is immediately available for all subsequent operations

### Sub-Tenant ID Best Practices

**For B2C Applications (Individual Users):**

```javascript theme={null}
// Use user IDs as sub-tenant IDs for personal workspaces
sub_tenant_id: "user_12345"
sub_tenant_id: "user_67890"
```

**For B2B Applications (Departments/Teams):**

```javascript theme={null}
// Use descriptive department or team names
sub_tenant_id: "engineering"
sub_tenant_id: "sales"
sub_tenant_id: "hr"
sub_tenant_id: "marketing"
```

**For Project-Based Organizations:**

```javascript theme={null}
// Use project identifiers
sub_tenant_id: "project_alpha"
sub_tenant_id: "client_acme_corp"
```

<Info>
  **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.
</Info>

<Warning>
  **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.
</Warning>

## Reserved Keywords

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.

## Metadata Schema Structure

Each schema object in the `tenant_metadata_schema` array should specify:

* **key**: The metadata field name (immutable once set)
* **type**: Data type (see supported types below)
* **searchable**: Whether this field can be used in search queries
* **filterable**: Whether this field can be used for filtering

## Supported Metadata Types

Cortex supports a comprehensive range of data types for metadata fields:

### Primitive Types

| 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                |

### Complex Types

| 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 vs Filterable Flags

Understanding the difference between `searchable` and `filterable` is crucial for optimal metadata design:

**1. Searchable Fields**

* **Purpose**: Fields that can be used in **semantic search queries** and **QnA operations**
* **Behavior**: Content is indexed for AI-powered search and question answering
* **Use When**: You want users to find documents by asking questions about these fields
* **Example**: `"Which documents are from the Engineering department?"`

```json theme={null}
{
  "key": "department", 
  "type": "string", 
  "searchable": true,  // ✅ Can be searched semantically
  "filterable": true
}
```

**2. Filterable Fields**

* **Purpose**: Fields that can be used for **precise filtering** and **exact matching**
* **Behavior**: Content is indexed for fast exact-match filtering operations
* **Use When**: You want to narrow down results with precise criteria
* **Example**: `department = "Engineering" AND status = "active"`

```json theme={null}
{
  "key": "data_classification", 
  "type": "string", 
  "searchable": false,  // ❌ Not semantically searchable
  "filterable": true    // ✅ Can be filtered exactly
}
```

**3. Combined Usage**

```json theme={null}
{
  "key": "compliance_framework", 
  "type": "string", 
  "searchable": true,   // ✅ "Find SOC2 compliance documents"
  "filterable": true    // ✅ compliance_framework = "SOC2"
}
```

## Comprehensive Examples

**Enterprise Setup - Multi-Department Organization**

```json theme={null}
[
  {
    "key": "department", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "compliance_framework", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "data_classification", 
    "type": "string", 
    "searchable": false, 
    "filterable": true
  },
  {
    "key": "business_unit", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "retention_period", 
    "type": "number", 
    "searchable": false, 
    "filterable": true
  },
  {
    "key": "is_confidential", 
    "type": "boolean", 
    "searchable": false, 
    "filterable": true
  },
  {
    "key": "created_date", 
    "type": "date", 
    "searchable": false, 
    "filterable": true
  }
]
```

**Legal Firm Setup - Client and Case Management**

```json theme={null}
[
  {
    "key": "practice_area", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "client_id", 
    "type": "string", 
    "searchable": false, 
    "filterable": true
  },
  {
    "key": "confidentiality_level", 
    "type": "string", 
    "searchable": false, 
    "filterable": true
  },
  {
    "key": "jurisdiction", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "case_priority", 
    "type": "number", 
    "searchable": false, 
    "filterable": true
  },
  {
    "key": "requires_approval", 
    "type": "boolean", 
    "searchable": false, 
    "filterable": true
  }
]
```

**Engineering Team Setup - Project and Component Management**

```json theme={null}
[
  {
    "key": "product_line", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "team", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "component", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "priority", 
    "type": "number", 
    "searchable": false, 
    "filterable": true
  },
  {
    "key": "is_critical", 
    "type": "boolean", 
    "searchable": false, 
    "filterable": true
  },
  {
    "key": "tags", 
    "type": "array", 
    "searchable": true, 
    "filterable": true
  }
]
```

**Simple Setup - Basic Organization**

```json theme={null}
[
  {
    "key": "organization", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "environment", 
    "type": "string", 
    "searchable": true, 
    "filterable": true
  },
  {
    "key": "version", 
    "type": "string", 
    "searchable": false, 
    "filterable": true
  }
]
```

## Metadata Best Practices

**1. Naming Conventions**

* **Use snake\_case**: `business_unit` instead of `businessUnit`
* **Be descriptive**: `data_classification_level` instead of `classification`
* **Use consistent prefixes**: `compliance_*`, `security_*`, `business_*`

**2. Type Selection Guidelines**

* **Strings**: For categorical data, identifiers, and labels
* **Numbers**: For quantitative metrics, versions, and priorities
* **Booleans**: For binary flags and status indicators
* **Dates**: For temporal data and audit trails
* **Arrays**: For multi-value fields like tags and categories
* **Objects**: For structured, hierarchical data

**3. Searchable vs Filterable Strategy**

* **Make searchable**: Fields users will ask questions about
* **Make filterable**: Fields used for precise result narrowing
* **Combine both**: For fields used in both semantic search and filtering
* **Filterable only**: For sensitive data or exact-match requirements

**4. Performance Considerations**

* **Limit total fields**: Keep metadata schema focused and purposeful
* **Use appropriate types**: Choose the most specific type for your data
* **Consider query patterns**: Design for your most common use cases
* **Plan for growth**: Design schema to accommodate future needs

## How Metadata Works in Practice

Once you've defined your tenant metadata schema, here's how it works with your documents:

### Document Upload with Metadata

When you upload documents, you'll provide both tenant and document metadata:

```json theme={null}
{
  "tenant_metadata": {
    "department": "Engineering",
    "compliance_framework": "SOC2",
    "data_classification": "internal",
    "business_unit": "Product",
    "retention_period": 7,
    "is_confidential": false,
    "created_date": "2024-01-15T10:30:00Z"
  },
  "document_metadata": {
    "title": "API Security Guidelines v2.1",
    "author": "Dr. Sarah Chen",
    "document_type": "technical_specification",
    "version": "2.1.0",
    "status": "approved"
  }
}
```

### Query Examples

With the metadata schema defined above, users can perform sophisticated queries:

#### Semantic Search (Searchable Fields)

```
"Find all engineering documents about security compliance"
```

* Searches through `department` (searchable: true)
* Searches through `compliance_framework` (searchable: true)
* Searches through document content and titles

#### Precise Filtering (Filterable Fields)

```
department = "Engineering" AND data_classification = "internal" AND is_confidential = false
```

* Exact match on `department` (filterable: true)
* Exact match on `data_classification` (filterable: true)
* Exact match on `is_confidential` (filterable: true)

#### Combined Queries

```
"Show me all SOC2 compliance documents from the Product business unit"
```

* Semantic search for "SOC2 compliance" (searchable fields)
* Precise filter: `business_unit = "Product"` (filterable: true)

### Real-World Use Cases

#### 1. Legal Document Management

**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"`

#### 2. Engineering Documentation

**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`

#### 3. HR Document Management

**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"`

### Metadata Inheritance

All documents in your tenant automatically inherit the tenant metadata schema you define. This means:

1. **Consistency**: Every document will have the same tenant metadata structure
2. **Compliance**: Organizational policies are enforced across all documents
3. **Queryability**: You can always filter and search by tenant-level attributes
4. **Scalability**: New documents automatically follow your established schema

### Migration and Updates

<Warning>
  **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
</Warning>

> **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](/essentials/metadata).

## Sample Response

```json theme={null}
{
  "status": "success",
  "message": "Tenant '99155#$@e2' created successfully.",
  "tenant_id": "B1SlKQ2j2l1aWYLa"
}
```

### Functionality

* Accepts an optional `tenant_id` via query
* Generates a new `tenant_id` if none is provided
* Creates and persists the tenant
* 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.

## Error Responses

All endpoints return consistent error responses following the standard format. For detailed error information, see our [Error Responses](/api-reference/error-responses) documentation.


## OpenAPI

````yaml POST /tenants/create
openapi: 3.1.0
info:
  title: Cortex SDK API
  description: REST APIs for Cortex AI retrieval engine
  version: 0.0.1
servers:
  - url: /
    description: Local
    x-fern-server-name: cortex-backend-local
  - url: https://api.usecortex.ai
    description: Production
    x-fern-server-name: cortex-prod
    x-fern-audiences:
      - public
  - url: https://preprod.usecortex.ai
    description: Staging
    x-fern-server-name: cortex-staging
security: []
paths:
  /tenants/create:
    post:
      tags:
        - tenants
      summary: Create Tenant
      description: >-
        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


        **Example Request:**

        ```json

        {
            "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:

        - A tenant is created and returned with its identifier.

        - If tenant_metadata_schema is provided, the vector store collection
        will include
          the specified custom fields with their configured search capabilities.
        - If the tenant already exists, you receive a success message with the
        existing identifier.
      operationId: create_tenant_tenants_create_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantCreateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantCreateResponse'
        '400':
          description: Bad Request - Invalid input parameters
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '401':
          description: Unauthorized - Authentication required
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '403':
          description: Forbidden - Access denied
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '404':
          description: Not Found - Resource does not exist
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '422':
          description: Unprocessable Entity - Validation failed
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cortex__models__response__commons__ActualErrorResponse
      security:
        - HTTPBearer: []
components:
  schemas:
    TenantCreateRequest:
      properties:
        tenant_id:
          type: string
          minLength: 1
          title: Tenant Id
          description: Unique tenant identifier
          example: tenant_1234
        is_embeddings_tenant:
          type: boolean
          title: Is Embeddings Tenant
          description: True to create embeddings tenant
          default: false
          example: true
        embeddings_dimension:
          anyOf:
            - type: integer
            - type: 'null'
          title: Embeddings Dimension
          description: >-
            Embedding dimensions for embeddings tenant. Not required for
            non-embeddings (is_embeddings_tenant=False) tenants
          default: 1536
        tenant_metadata_schema:
          anyOf:
            - items:
                $ref: '#/components/schemas/CustomPropertyDefinition'
              type: array
            - type: 'null'
          title: Tenant Metadata Schema
          description: >-
            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.
          examples:
            - - 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
          example:
            - key: department
              type: string
              searchable: true
              filterable: true
            - key: compliance_framework
              type: string
              searchable: true
              filterable: false
            - key: data_classification
              type: string
              searchable: false
              filterable: true
      type: object
      required:
        - tenant_id
      title: TenantCreateRequest
      description: >-
        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
                    }
                ]
            }
    TenantCreateResponse:
      properties:
        tenant_id:
          type: string
          title: Tenant Id
          description: Identifier provided by user
          example: tenant_1234
        infra:
          $ref: '#/components/schemas/Infra'
          description: Infra status
        metadata_schema:
          anyOf:
            - $ref: '#/components/schemas/TenantMetadataSchemaInfo'
            - type: 'null'
          description: Summary of configured tenant metadata schema (if provided)
        message:
          type: string
          title: Message
          description: Summary message
          default: Tenant created and infra provisioning triggered
      type: object
      required:
        - tenant_id
        - infra
      title: TenantCreateResponse
    cortex__models__response__commons__ActualErrorResponse:
      properties:
        detail:
          $ref: >-
            #/components/schemas/cortex__models__response__commons__ErrorResponse
      type: object
      required:
        - detail
      title: ActualErrorResponse
    CustomPropertyDefinition:
      properties:
        name:
          type: string
          title: Name
          description: Property name (used as field name in Milvus)
          example: <name>
        data_type:
          $ref: '#/components/schemas/MilvusDataType'
          description: Milvus data type. Use VARCHAR for text fields that need embeddings.
          default: VARCHAR
        max_length:
          type: integer
          title: Max Length
          description: Max length for VARCHAR fields. Increase for longer text content.
          default: 1024
          example: 1
        enable_analyzer:
          type: boolean
          title: Enable Analyzer
          description: Enable text analyzer for full-text search capabilities
          default: false
          example: true
        enable_match:
          type: boolean
          title: Enable Match
          description: Enable TEXT_MATCH filtering on this field
          default: false
          example: true
        enable_dense_embedding:
          type: boolean
          title: Enable Dense Embedding
          description: >-
            Create a dense embedding field (FLOAT_VECTOR) for semantic
            similarity search. Only applicable to VARCHAR fields. A
            corresponding '{name}_embedding' field will be created.
          default: false
          example: true
        enable_sparse_embedding:
          type: boolean
          title: Enable Sparse Embedding
          description: >-
            Create a sparse embedding field (BM25) for keyword search. Only
            applicable to VARCHAR fields. A corresponding '{name}_sparse' field
            and BM25 function will be created.
          default: false
          example: true
        nullable:
          type: boolean
          title: Nullable
          description: Whether field can be null
          default: true
          example: true
      type: object
      required:
        - name
      title: CustomPropertyDefinition
      description: >-
        Definition for custom/dynamic properties on a collection.


        Use this to define tenant metadata fields that can enhance search
        capabilities:

        - enable_dense_embedding: Creates a dense vector field for semantic
        similarity search

        - enable_sparse_embedding: Creates a sparse vector field for BM25
        keyword search


        Example:
            CustomPropertyDefinition(
                name="product_description",
                data_type=MilvusDataType.VARCHAR,
                max_length=4096,
                enable_dense_embedding=True,  # Enables semantic search on this field
                enable_sparse_embedding=True,  # Enables keyword search on this field
            )
    Infra:
      properties:
        scheduler_status:
          type: boolean
          title: Scheduler Status
          example: true
        graph_status:
          type: boolean
          title: Graph Status
          example: true
        vectorstore_status:
          prefixItems:
            - type: boolean
            - type: boolean
          type: array
          maxItems: 2
          minItems: 2
          title: Vectorstore Status
          example: []
      type: object
      required:
        - scheduler_status
        - graph_status
        - vectorstore_status
      title: Infra
    TenantMetadataSchemaInfo:
      properties:
        field_count:
          type: integer
          title: Field Count
          description: Number of custom metadata fields configured
          example: 1
        dense_embedding_fields:
          items:
            type: string
          type: array
          title: Dense Embedding Fields
          description: Fields with dense embeddings enabled for semantic search
          example: []
        sparse_embedding_fields:
          items:
            type: string
          type: array
          title: Sparse Embedding Fields
          description: Fields with sparse embeddings enabled for keyword search
          example: []
      type: object
      required:
        - field_count
      title: TenantMetadataSchemaInfo
      description: Summary of configured tenant metadata schema fields.
    cortex__models__response__commons__ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          default: false
          example: true
        message:
          type: string
          title: Message
          default: Error occurred
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ErrorResponse
    MilvusDataType:
      type: string
      enum:
        - BOOL
        - INT8
        - INT16
        - INT32
        - INT64
        - FLOAT
        - DOUBLE
        - VARCHAR
        - JSON
        - ARRAY
        - FLOAT_VECTOR
        - SPARSE_FLOAT_VECTOR
      title: MilvusDataType
      description: Milvus data types mapped from Weaviate schema.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````