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

# Get Or Create Default Namespace

> Get or create the default universal namespace.

Returns the existing default namespace if one exists, or creates a new one
using the universal template. This is the primary onboarding entry point —
Studio calls this on first upload to ensure a namespace exists without
requiring the user to choose a template.

The default namespace supports all file types (video, image, audio, PDF, text)
with pre-configured extractors and a universal retriever.

If the request carries an `X-Namespace` header that resolves to an existing
writable org namespace (e.g. one just created via the wizard), the scaffold
is provisioned into THAT namespace instead of creating a "default" one.



## OpenAPI

````yaml post /v1/templates/scaffolds/default
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/default:
    post:
      tags:
        - Scaffold Templates
      summary: Get Or Create Default Namespace
      description: >-
        Get or create the default universal namespace.


        Returns the existing default namespace if one exists, or creates a new
        one

        using the universal template. This is the primary onboarding entry point
        —

        Studio calls this on first upload to ensure a namespace exists without

        requiring the user to choose a template.


        The default namespace supports all file types (video, image, audio, PDF,
        text)

        with pre-configured extractors and a universal retriever.


        If the request carries an `X-Namespace` header that resolves to an
        existing

        writable org namespace (e.g. one just created via the wizard), the
        scaffold

        is provisioned into THAT namespace instead of creating a "default" one.
      operationId: get_or_create_default_namespace_v1_templates_scaffolds_default_post
      parameters: []
      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: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    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
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  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 header returns
        403; an invalid or revoked key returns 401.

````