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

# Instantiate Namespace Template

> Instantiate namespace template.



## OpenAPI

````yaml post /v1/templates/namespaces/{template_id}/instantiate
openapi: 3.1.0
info:
  title: Mixpeek API
  description: >-
    This is the Mixpeek API, providing access to various endpoints for data
    processing and retrieval.
  termsOfService: https://mixpeek.com/terms
  contact:
    name: Mixpeek Support
    url: https://mixpeek.com/contact
    email: info@mixpeek.com
  version: '0.82'
servers:
  - url: https://api.mixpeek.com
    description: Production
security: []
paths:
  /v1/templates/namespaces/{template_id}/instantiate:
    post:
      tags:
        - Templates
        - Namespace Templates
      summary: Instantiate Namespace Template
      description: Instantiate namespace template.
      operationId: >-
        instantiate_namespace_template_v1_templates_namespaces__template_id__instantiate_post
      parameters:
        - name: template_id
          in: path
          required: true
          schema:
            type: string
            description: Template ID
            title: Template Id
          description: Template ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstantiateTemplateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstantiatedTemplateResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    InstantiateTemplateRequest:
      properties:
        namespace_name:
          type: string
          maxLength: 50
          minLength: 3
          title: Namespace Name
          description: >-
            Name for the new namespace. REQUIRED. Must be unique within your
            organization. Used as identifier and display name. Format: 3-50
            characters, alphanumeric with underscores/hyphens, lowercase
            recommended. Cannot match existing namespace names.
          examples:
            - my_ecommerce_demo
            - test_media_lib
            - demo_docs_2024
        description:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Description
          description: >-
            Optional description for the namespace. NOT REQUIRED. If not
            provided, uses the template's description. Useful for adding context
            about your specific use case. Format: 0-500 characters, plain text.
          examples:
            - Testing e-commerce search features for Q4 launch
            - Demo environment for customer presentation
            - null
      type: object
      required:
        - namespace_name
      title: InstantiateTemplateRequest
      description: >-
        Request to create a new namespace from a template.


        Instantiation clones all data from the template's source namespace
        including:

        - Namespace configuration (feature extractors, indexes)

        - Qdrant vectors and payloads (pre-computed embeddings)

        - MongoDB metadata (collections, documents)


        The process is fast (<5 seconds) because data is cloned, not
        reprocessed.


        Use Cases:
            - First-time user onboarding with working examples
            - Creating demo environments for sales/trials
            - Spinning up test environments with known data
            - Providing industry-specific starting points

        Requirements:
            - namespace_name: REQUIRED, must be unique within organization
            - description: OPTIONAL, defaults to template description if not provided

        Validation:
            - Checks namespace name uniqueness before creation
            - Validates template exists and is active
            - Ensures source namespace is accessible
      examples:
        - namespace_name: my_demo
        - description: Demo environment for ACME Corp presentation
          namespace_name: customer_demo_2024
        - description: Testing product similarity search before production
          namespace_name: test_ecommerce_search
    InstantiatedTemplateResponse:
      properties:
        namespace_id:
          type: string
          title: Namespace Id
          description: >-
            ID of the newly created namespace. REQUIRED. Use this ID in the
            X-Namespace header for all API calls to this namespace. Format:
            namespace ID starting with 'ns_'. Permanent identifier for the
            namespace.
          examples:
            - ns_abc123xyz
            - ns_demo456def
            - ns_test789ghi
        namespace_name:
          type: string
          title: Namespace Name
          description: >-
            Name of the newly created namespace. REQUIRED. Matches the
            namespace_name from the request. Human-readable identifier shown in
            UI. Can be used for namespace lookup via GET /namespaces/{name}.
          examples:
            - my_ecommerce_demo
            - customer_demo_2024
            - test_media_lib
        template_id:
          type: string
          title: Template Id
          description: >-
            ID of the template that was instantiated. REQUIRED. Reference to the
            source template used for creation. Useful for tracking which
            template produced this namespace. Format: template ID starting with
            'tmpl_'.
          examples:
            - tmpl_ecommerce
            - tmpl_media_library
            - tmpl_legal_docs
        status:
          type: string
          title: Status
          description: >-
            Instantiation status. REQUIRED. 'cloning' means the namespace is
            being created and data is being copied. 'ready' means the namespace
            is fully functional and ready to use. 'failed' means the cloning
            process encountered an error. Poll GET /namespaces/{namespace_id} to
            check when status becomes 'ready'. All data is cloned including
            collections, vectors, retrievers, and taxonomies.
          default: cloning
          examples:
            - cloning
            - ready
            - failed
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
          description: >-
            Task ID for tracking the clone operation. Can be used to poll task
            status if needed. Format: UUID string.
          examples:
            - a1b2c3d4-e5f6-7890-abcd-ef1234567890
        created_at:
          type: string
          format: date-time
          title: Created At
          description: >-
            Timestamp when namespace was created. REQUIRED. Auto-generated by
            server. Format: ISO 8601 datetime in UTC. Used for auditing and
            sorting namespaces by creation time.
      type: object
      required:
        - namespace_id
        - namespace_name
        - template_id
      title: InstantiatedTemplateResponse
      description: >-
        Response after successful template instantiation.


        Provides all information needed to start using the newly created
        namespace,

        including IDs for API calls and status information.


        The namespace is immediately ready for use when status is 'ready'.

        All collections, documents, and feature stores are fully functional.


        Use Cases:
            - Retrieve namespace_id for subsequent API calls
            - Verify instantiation completed successfully
            - Track which template was used for the namespace
            - Record creation timestamp for auditing

        Fields:
            All fields are REQUIRED and populated by the server.
      examples:
        - created_at: '2024-10-31T12:00:00Z'
          description: Template instantiation started - cloning in progress
          namespace_id: ns_abc123xyz
          namespace_name: my_ecommerce_demo
          status: cloning
          task_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
          template_id: tmpl_ecommerce
        - created_at: '2024-10-31T14:30:00Z'
          description: Customer demo environment ready
          namespace_id: ns_demo456def
          namespace_name: customer_demo_2024
          status: ready
          template_id: tmpl_media_library
        - created_at: '2024-10-31T16:45:00Z'
          description: Test namespace from legal template
          namespace_id: ns_test789ghi
          namespace_name: test_legal_search
          status: cloning
          task_id: b2c3d4e5-f6a7-8901-bcde-f23456789012
          template_id: tmpl_legal_docs
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Always false for error responses
          default: false
        status:
          type: integer
          title: Status
          description: HTTP status code for this error
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: Error details payload
      type: object
      required:
        - status
        - error
      title: ErrorResponse
      description: Error response model.
      examples:
        - error:
            details:
              id: ns_123
              resource: namespace
            message: Namespace not found
            type: NotFoundError
          status: 404
          success: false
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error message
        type:
          type: string
          title: Type
          description: Stable error type identifier (machine-readable)
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Fine-grained error code for programmatic handling (e.g.,
            namespace_name_taken, feature_extractor_not_found). Present only
            when consumers may need to branch on a specific error condition.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Optional structured details to help debugging (validation errors,
            IDs, etc.)
      type: object
      required:
        - message
        - type
      title: ErrorDetail
      description: Error detail model.
    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

````