> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mielto.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Collection

> Create new collection.



## OpenAPI

````yaml api-reference/openapi.json post /api/v1/collections
openapi: 3.1.0
info:
  title: FastAPI app
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/collections:
    post:
      tags:
        - Collections
      summary: Create Collection
      description: Create new collection.
      operationId: create_collection_api_v1_collections_post
      parameters:
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The workspace ID
            title: X-Workspace-Id
          description: The workspace ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollectionCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionRead'
        '404':
          description: Collection not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - DualAuthScheme: []
components:
  schemas:
    CollectionCreate:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Collection name
        description:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Description
          description: Collection description
        store_type:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/CollectionStoreType'
            - type: 'null'
          title: Store Type
          description: Storage type for the collection
        visibility:
          type: string
          title: Visibility
          description: Collection visibility (private/public)
          default: private
        status:
          type: string
          title: Status
          description: Collection status
          default: active
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Collection tags for organization
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
          description: Reference to parent collection
        stats:
          additionalProperties: true
          type: object
          title: Stats
          description: Collection statistics
          default: {}
        meta_data:
          additionalProperties: true
          type: object
          title: Meta Data
          description: Collection metadata
          default: {}
        settings:
          additionalProperties: true
          type: object
          title: Settings
          description: Collection configuration settings
          default: {}
        embedding:
          anyOf:
            - $ref: '#/components/schemas/EmbeddingModelSettings'
            - type: 'null'
          description: Embedding configuration
          default: {}
        source_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Type
          description: Collection source type
          default: document
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
          description: Collection source ID
      type: object
      required:
        - name
      title: CollectionCreate
      description: Schema for creating a new collection.
    CollectionRead:
      properties:
        id:
          type: string
          title: Id
          description: Collection ID
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Collection name
        description:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Description
          description: Collection description
        store_type:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/CollectionStoreType'
            - type: 'null'
          title: Store Type
          description: Storage type for the collection
        visibility:
          type: string
          title: Visibility
          description: Collection visibility (private/public)
          default: private
        status:
          type: string
          title: Status
          description: Collection status
          default: active
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Collection tags for organization
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
          description: Reference to parent collection
        stats:
          additionalProperties: true
          type: object
          title: Stats
          description: Collection statistics
          default: {}
        meta_data:
          additionalProperties: true
          type: object
          title: Meta Data
          description: Collection metadata
          default: {}
        settings:
          additionalProperties: true
          type: object
          title: Settings
          description: Collection configuration settings
          default: {}
        embedding:
          anyOf:
            - $ref: '#/components/schemas/EmbeddingModelSettings'
            - type: 'null'
          description: Embedding configuration
          default: {}
        source_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Type
          description: Collection source type
          default: document
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
          description: Collection source ID
        workspace_id:
          type: string
          title: Workspace Id
          description: Reference to workspace
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: User who created the collection
      type: object
      required:
        - id
        - name
        - workspace_id
      title: CollectionRead
      description: Schema for reading collection data.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CollectionStoreType:
      type: string
      enum:
        - pgvector
        - langchain_pgvector
        - chroma
        - pinecone
        - milvus
        - qdrant
        - mongodb
        - upstash
      title: CollectionStoreType
    EmbeddingModelSettings:
      properties:
        provider:
          anyOf:
            - $ref: '#/components/schemas/EmbeddingProvider'
            - type: string
            - type: 'null'
          title: Provider
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        dimensions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Dimensions
        use_default_cred:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Use Default Cred
          default: true
        credentials:
          anyOf:
            - $ref: '#/components/schemas/EmbeddingModelCustomCredentials'
            - type: 'null'
      type: object
      title: EmbeddingModelSettings
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    EmbeddingProvider:
      type: string
      enum:
        - openai
        - azure_openai
        - aws_bedrock
        - sentence_transformer
        - voyageai
        - google
        - ollama
        - mistral
        - cohere
        - jina
        - huggingface
        - together
      title: EmbeddingProvider
    EmbeddingModelCustomCredentials:
      properties:
        api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Key
        credential_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Credential Id
        organization:
          anyOf:
            - type: string
            - type: 'null'
          title: Organization
        base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Url
        batch_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Batch Size
        max_retries:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Retries
        timeout:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout
      type: object
      title: EmbeddingModelCustomCredentials
  securitySchemes:
    DualAuthScheme:
      type: http
      scheme: bearer

````