> ## 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 Scaffold Template

> Create complete infrastructure from scaffold template.

Creates all resources atomically:
1. **Namespace** with configured feature extractors
2. **Bucket** with schema for your data structure
3. **Collection** linked to bucket with feature config
4. **Retriever** with search pipeline stages

All resources are empty, ready for data upload.

**Next Steps:**
1. Upload data: `POST /v1/buckets/{bucket_id}/objects`
2. Process batch: `POST /v1/collections/{collection_id}/batches`
3. Search: `POST /v1/retrievers/{retriever_id}/retrieve`

**Example Request:**
```json
{
    "namespace_name": "my_video_app",
    "namespace_description": "Video search application"
}
```



## OpenAPI

````yaml post /v1/templates/scaffolds/{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:
  - BearerAuth: []
paths:
  /v1/templates/scaffolds/{template_id}/instantiate:
    post:
      tags:
        - Scaffold Templates
      summary: Instantiate Scaffold Template
      description: |-
        Create complete infrastructure from scaffold template.

        Creates all resources atomically:
        1. **Namespace** with configured feature extractors
        2. **Bucket** with schema for your data structure
        3. **Collection** linked to bucket with feature config
        4. **Retriever** with search pipeline stages

        All resources are empty, ready for data upload.

        **Next Steps:**
        1. Upload data: `POST /v1/buckets/{bucket_id}/objects`
        2. Process batch: `POST /v1/collections/{collection_id}/batches`
        3. Search: `POST /v1/retrievers/{retriever_id}/retrieve`

        **Example Request:**
        ```json
        {
            "namespace_name": "my_video_app",
            "namespace_description": "Video search application"
        }
        ```
      operationId: >-
        instantiate_scaffold_template_v1_templates_scaffolds__template_id__instantiate_post
      parameters:
        - name: template_id
          in: path
          required: true
          schema:
            type: string
            title: Template Id
            description: Scaffold template ID
          description: Scaffold template ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstantiateScaffoldRequest'
        description: >-
          Keys this body does not declare are refused with 422 extra_forbidden
          naming the accepted keys (since 2026-11-02).
        x-unknown-keys:
          until: '2026-11-02'
          then: 422 extra_forbidden
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstantiatedScaffoldResponse'
        '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: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    InstantiateScaffoldRequest:
      properties:
        namespace_name:
          type: string
          maxLength: 20
          minLength: 3
          title: Namespace Name
          description: Name for the new namespace (required, must be unique)
        namespace_description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Namespace Description
          description: Optional description for the namespace
        bucket_name:
          anyOf:
            - type: string
              maxLength: 100
              minLength: 1
            - type: 'null'
          title: Bucket Name
          description: Override default bucket name from scaffold
        collection_name:
          anyOf:
            - type: string
              maxLength: 100
              minLength: 1
            - type: 'null'
          title: Collection Name
          description: Override default collection name from scaffold
        retriever_name:
          anyOf:
            - type: string
              maxLength: 100
              minLength: 1
            - type: 'null'
          title: Retriever Name
          description: Override default retriever name from scaffold
        include_sample_data:
          type: boolean
          title: Include Sample Data
          description: >-
            If true, include sample data from demo namespace. If false, create
            empty resources.
          default: false
      type: object
      required:
        - namespace_name
      title: InstantiateScaffoldRequest
      description: |-
        Request to instantiate a scaffold template.

        Only namespace_name is required. Other names use scaffold defaults.

        Options:
            include_sample_data: If true, clone from demo namespace with sample data.
                                If false (default), create empty resources.

        Example:
            # Empty scaffold
            {"namespace_name": "my_app"}

            # With sample data
            {"namespace_name": "my_app", "include_sample_data": true}
      examples:
        - namespace_name: my_video_app
        - include_sample_data: true
          namespace_name: my_video_app
        - bucket_name: my_videos
          collection_name: video_embeddings
          namespace_description: Video search application
          namespace_name: my_video_app
          retriever_name: video_search
    InstantiatedScaffoldResponse:
      properties:
        namespace_id:
          type: string
          title: Namespace Id
          description: Created namespace ID (ns_xxx)
        namespace_name:
          type: string
          title: Namespace Name
          description: Created namespace name
        bucket_id:
          type: string
          title: Bucket Id
          description: Created bucket ID (bkt_xxx)
        bucket_name:
          type: string
          title: Bucket Name
          description: Created bucket name
        collection_id:
          type: string
          title: Collection Id
          description: Created collection ID (col_xxx)
        collection_name:
          type: string
          title: Collection Name
          description: Created collection name
        retriever_id:
          type: string
          title: Retriever Id
          description: Created retriever ID (ret_xxx)
        retriever_name:
          type: string
          title: Retriever Name
          description: Created retriever name
        template_id:
          type: string
          title: Template Id
          description: Scaffold template ID used
        status:
          type: string
          title: Status
          description: >-
            Status: 'created' for a synchronous (empty) instantiation, 'cloning'
            when sample data is cloning in the background
          default: created
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
          description: >-
            Background clone task id when status='cloning' — poll the task, or
            GET the namespace and read clone_status, to track sample-data
            progress. Null for synchronous (empty) instantiation.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: UTC timestamp of creation
      type: object
      required:
        - namespace_id
        - namespace_name
        - bucket_id
        - bucket_name
        - collection_id
        - collection_name
        - retriever_id
        - retriever_name
        - template_id
      title: InstantiatedScaffoldResponse
      description: |-
        Response after successful scaffold instantiation.

        Contains IDs and names of all four created resources.
        Use these IDs for subsequent operations:
        - Upload data: POST /v1/buckets/{bucket_id}/objects
        - Process: POST /v1/collections/{collection_id}/batches
        - Search: POST /v1/retrievers/{retriever_id}/retrieve
      examples:
        - bucket_id: bkt_xyz789
          bucket_name: videos
          collection_id: col_def456
          collection_name: video_embeddings
          created_at: '2025-01-15T12:00:00Z'
          namespace_id: ns_abc123
          namespace_name: my_video_app
          retriever_id: ret_ghi012
          retriever_name: video_search
          status: created
          template_id: tmpl_scaffold_video_understanding
    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
    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.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Mixpeek API key, sent as `Authorization: Bearer mxp_sk_...`. Create one
        in Studio under Settings → API Keys, or with an admin key via `POST
        /v1/organizations/users/{user_email}/api-keys`. A missing, malformed,
        unknown, revoked, inactive or expired key returns 401; a key without the
        permission, scope or plan an operation needs returns 403.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.