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

# List Retriever Templates

> List retriever templates (system + organization + user).

Supports filtering, sorting, and search like other list operations.

**Request Body (optional):**
- `filters`: Attribute-based filters `{"AND": [{"field": "category", "operator": "eq", "value": "semantic_search"}]}`
- `sort`: Sort options `{"field": "name", "direction": "asc"}`
- `search`: Wildcard search across template_id, name, description, tags
- `scope`: Filter by scope (system, organization, user)
- `category`: Filter by category
- `is_active`: Show only active templates (default: true)
- `tags`: Filter by tags (templates must have ALL specified tags)



## OpenAPI

````yaml post /v1/templates/retrievers
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/retrievers:
    post:
      tags:
        - Templates
        - Retriever Templates
      summary: List Retriever Templates
      description: >-
        List retriever templates (system + organization + user).


        Supports filtering, sorting, and search like other list operations.


        **Request Body (optional):**

        - `filters`: Attribute-based filters `{"AND": [{"field": "category",
        "operator": "eq", "value": "semantic_search"}]}`

        - `sort`: Sort options `{"field": "name", "direction": "asc"}`

        - `search`: Wildcard search across template_id, name, description, tags

        - `scope`: Filter by scope (system, organization, user)

        - `category`: Filter by category

        - `is_active`: Show only active templates (default: true)

        - `tags`: Filter by tags (templates must have ALL specified tags)
      operationId: list_retriever_templates_v1_templates_retrievers_post
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListTemplatesRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTemplatesResponse'
        '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: []
          NamespaceHeader: []
components:
  schemas:
    ListTemplatesRequest:
      properties:
        filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Filters
          description: >-
            Filters to apply when listing templates. Format: {"AND": [{"field":
            "field_name", "operator": "eq", "value": "value"}]}
        sort:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Sort
          description: >-
            Sort options for the results. Format: {'field': 'name', 'direction':
            'asc'}
        search:
          anyOf:
            - type: string
            - type: 'null'
          title: Search
          description: >-
            Search term for wildcard search across template_id, name,
            description, and tags
        scope:
          anyOf:
            - $ref: '#/components/schemas/TemplateScope'
            - type: 'null'
          description: Filter by scope (system, organization, or user)
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: Filter by category
        is_active:
          type: boolean
          title: Is Active
          description: Show only active templates
          default: true
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Filter by tags (templates must have ALL specified tags)
      type: object
      title: ListTemplatesRequest
      description: |-
        Request model for listing templates.

        Provides the same filtering, sorting, and search capabilities as other
        list operations (list collections, list buckets, etc.).
      examples:
        - category: semantic_search
          is_active: true
          scope: system
          search: semantic
        - filters:
            AND:
              - field: category
                operator: eq
                value: advanced_search
          sort:
            direction: asc
            field: name
    ListTemplatesResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/BaseTemplateModel'
          type: array
          title: Results
          description: List of templates
        total_count:
          type: integer
          title: Total Count
          description: Total number of templates matching the query
      type: object
      required:
        - results
        - total_count
      title: ListTemplatesResponse
      description: Response model for listing templates.
      examples:
        - results:
            - category: semantic_search
              description: Simple text-based semantic search
              internal_id: system
              is_active: true
              is_public: true
              name: Basic Semantic Search
              scope: system
              template_id: tmpl_semantic_search
              template_type: retriever
          total_count: 1
    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
    TemplateScope:
      type: string
      enum:
        - system
        - organization
        - user
        - public
      title: TemplateScope
      description: |-
        Scope of template availability.

        system: Mixpeek-provided, available to all orgs
        organization: Private to org members
        user: Private to creator only
        public: User-created, discoverable by all orgs (marketplace)
    BaseTemplateModel:
      properties:
        template_id:
          type: string
          pattern: ^tmpl_[a-z0-9_]+$
          title: Template Id
          description: Unique template identifier (e.g., 'tmpl_semantic_search')
        template_type:
          $ref: '#/components/schemas/TemplateType'
          description: Type of resource this template creates
        mode:
          $ref: '#/components/schemas/TemplateMode'
          description: >-
            Template instantiation mode: clone (with data), config (empty), or
            scaffold (preset)
          default: config
        scope:
          $ref: '#/components/schemas/TemplateScope'
          description: Template scope (system or organization)
        internal_id:
          type: string
          title: Internal Id
          description: >-
            Organization internal ID. For system templates, use 'system'. For
            org templates, use the actual internal_id.
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Human-readable template name
        description:
          type: string
          maxLength: 1000
          minLength: 1
          title: Description
          description: Detailed description of the template's purpose
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: Optional category for organizing templates
        configuration:
          additionalProperties: true
          type: object
          title: Configuration
          description: Template-specific configuration (varies by template_type)
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: Tags for categorizing and filtering templates
        is_active:
          type: boolean
          title: Is Active
          description: Whether this template is available for use
          default: true
        is_public:
          type: boolean
          title: Is Public
          description: >-
            Whether this template is publicly discoverable without
            authentication
          default: false
        use_cases:
          items:
            type: string
          type: array
          title: Use Cases
          description: List of common use cases for this template
        requirements:
          items:
            type: string
          type: array
          title: Requirements
          description: List of requirements (e.g., 'Requires text embeddings')
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: User ID who created this template (for org templates)
        source_resource_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Resource Id
          description: >-
            ID of the resource this template was created from (for org
            templates)
        sample_namespace_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Sample Namespace Id
          description: >-
            Reference to a sample/golden namespace for this scaffold (used for
            Studio quickstart cloning)
        example_queries:
          items:
            type: string
          type: array
          title: Example Queries
          description: >-
            Runnable example queries for this template's sample data; the first
            renders on the card
        whats_inside:
          anyOf:
            - type: string
            - type: 'null'
          title: Whats Inside
          description: >-
            One-sentence description of the sample corpus (what you get, with
            counts)
        materialize_estimate:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialize Estimate
          description: >-
            Honest time estimate for sample data to become searchable after
            instantiate
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when template was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Timestamp when template was last updated
      type: object
      required:
        - template_id
        - template_type
        - scope
        - internal_id
        - name
        - description
        - configuration
      title: BaseTemplateModel
      description: |-
        Base template model with common fields for all template types.

        This model is stored in MongoDB and supports three template scopes:
        - System: Mixpeek defaults (all orgs)
        - Organization: All users in the org
        - User: Only the creator
      examples:
        - category: semantic_search
          configuration:
            input_schema: {}
            stages: []
          created_at: '2025-01-15T12:00:00Z'
          description: Simple text-based semantic search
          internal_id: system
          is_active: true
          is_public: true
          name: Basic Semantic Search
          scope: system
          template_id: tmpl_semantic_search
          template_type: retriever
    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
    TemplateType:
      type: string
      enum:
        - namespace
        - retriever
        - cluster
        - collection
        - bucket
        - taxonomy
        - scaffold
      title: TemplateType
      description: Types of resources that can be templated.
    TemplateMode:
      type: string
      enum:
        - scaffold
        - config
        - clone
      title: TemplateMode
      description: |-
        Mode of template instantiation.

        scaffold: Create from pre-built preset
            - Creates: namespace + bucket + collection + retriever
            - Endpoint: POST /templates/scaffolds/{id}/instantiate
            - All resources empty, ready for data

        config: Copy resource configuration only
            - Creates: empty resource with same settings
            - Endpoint: POST /templates/{resource}/{id}/instantiate
            - No data copied

        clone: Copy resource with all data
            - Creates: full copy including vectors/embeddings
            - Endpoint: POST /namespaces/{id}/clone
            - For config-only, use templates instead
  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.
    NamespaceHeader:
      type: apiKey
      in: header
      name: X-Namespace
      description: >-
        Namespace id (`ns_...`), not the namespace name. This scopes the request
        rather than authenticating it, and it is required on every operation
        marked `x-mixpeek-namespace-scoped`.

````