Skip to main content
POST
/
v1
/
retrievers
Create Retriever
curl --request POST \
  --url https://api.mixpeek.com/v1/retrievers \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "retriever_name": "<string>",
  "stages": [
    {
      "stage_name": "<string>",
      "config": {},
      "stage_type": "filter",
      "batch_size": "<string>",
      "description": "<string>"
    }
  ],
  "description": "<string>",
  "collection_identifiers": [
    "<string>"
  ],
  "input_schema": {},
  "budget_limits": {
    "max_credits": 1,
    "max_time_ms": 1
  },
  "tags": [
    "<string>"
  ],
  "display_config": {
    "components": {
      "result_card": {
        "card_click_action": "viewDetails",
        "field_order": [
          "title",
          "description",
          "price"
        ],
        "layout": "vertical",
        "show_find_similar": true,
        "show_thumbnail": true
      },
      "result_layout": "grid",
      "show_hero": true,
      "show_results_header": true,
      "show_search": true
    },
    "custom_cta": {
      "label": "Search Tips",
      "markdown_content": "# Search Tips\n\n- Use quotes for exact phrases\n- Try descriptive terms"
    },
    "description": "Search through our product catalog",
    "exposed_fields": [
      "title",
      "description",
      "price",
      "image_url"
    ],
    "field_config": {
      "price": {
        "format": "number",
        "format_options": {
          "decimals": 2,
          "label": "Price",
          "prefix": "$"
        }
      },
      "title": {
        "format": "text",
        "format_options": {
          "label": "Product Name",
          "truncate_chars": 60
        }
      }
    },
    "field_mappings": {
      "thumbnail": "image_url",
      "title": "title"
    },
    "inputs": [
      {
        "field_name": "query",
        "field_schema": {
          "description": "Search query",
          "examples": [
            "wireless headphones",
            "laptop"
          ],
          "type": "string"
        },
        "input_type": "text",
        "label": "Search Products",
        "order": 0,
        "placeholder": "What are you looking for?",
        "required": true
      }
    ],
    "layout": {
      "columns": 3,
      "gap": "16px",
      "mode": "grid"
    },
    "logo_url": "https://example.com/logo.png",
    "markdowns": [
      {
        "content": "# AI-Powered Product Search\n\nOur search uses **machine learning** to understand your queries and find the most relevant products.\n\n## Features\n\n- **Semantic Search**: Understands meaning, not just keywords\n- **Visual Search**: Upload images to find similar products\n- **Smart Filters**: Automatically suggests relevant filters",
        "title": "How it Works"
      },
      {
        "content": "## Tips for Better Results\n\n1. Use descriptive terms (e.g., \"wireless noise-canceling headphones\")\n2. Try different keywords if you don't find what you're looking for\n3. Use filters to narrow down results\n\n*Happy searching!*",
        "title": "Search Guide"
      }
    ],
    "template_type": "media-search",
    "theme": {
      "border_radius": "12px",
      "card_style": "elevated",
      "font_family": "Inter, sans-serif",
      "primary_color": "#007AFF"
    },
    "title": "Product Search"
  }
}
EOF
{
  "retriever": {
    "retriever_name": "<string>",
    "stages": [
      {
        "stage_name": "<string>",
        "config": {},
        "stage_type": "filter",
        "batch_size": "<string>",
        "description": "<string>"
      }
    ],
    "retriever_id": "<string>",
    "description": "<string>",
    "collection_ids": [
      "<string>"
    ],
    "input_schema": {},
    "budget_limits": {
      "max_credits": 1,
      "max_time_ms": 1
    },
    "feature_dependencies": [
      {
        "extractor": "<string>",
        "version": "<string>",
        "scheme": "mixpeek",
        "output": "<string>"
      }
    ],
    "tags": [
      "<string>"
    ],
    "display_config": {},
    "version": 1,
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "created_by": "<string>",
    "updated_by": "<string>"
  }
}

Headers

Authorization
string

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

Examples:

"Bearer YOUR_API_KEY"

"Bearer YOUR_STRIPE_API_KEY"

X-Namespace
string

REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'

Examples:

"ns_abc123def456"

"production"

"my-namespace"

Body

application/json

Payload for creating a new retriever.

retriever_name
string
required

Unique retriever name (REQUIRED).

Minimum string length: 1
stages
StageConfig · object[]
required

Ordered stage configurations (REQUIRED).

Minimum array length: 1
description
string | null

Human readable retriever description (OPTIONAL).

collection_identifiers
string[]

Collection identifiers (names or IDs) queried by the retriever (OPTIONAL). Identifiers can be collection names (e.g., 'my_collection') or collection IDs (e.g., 'col_abc123'). The system will resolve names to IDs automatically. Can be empty for inference-only pipelines (e.g., LLM query analysis without document retrieval).

Examples:
["my_collection", "products"]
["col_abc123", "col_def456"]
[]
input_schema
Input Schema · object

Input schema properties keyed by field name (OPTIONAL). Can be empty for static retrievers with hardcoded stage parameters. Each field can include: type, description, required, default, and examples. The 'examples' field (list) provides sample values that will be shown to users when the retriever is published with include_metadata=true.

Example:
{
"category": {
"description": "Filter by category",
"examples": ["electronics", "clothing"],
"required": false,
"type": "string"
},
"query": {
"description": "Search query text",
"examples": ["red sports car", "sunset over ocean"],
"required": true,
"type": "text"
}
}
budget_limits
BudgetLimits · object

Budget limits for execution (OPTIONAL).

Examples:
{ "max_credits": 100, "max_time_ms": 60000 }
{ "max_time_ms": 120000 }
tags
string[]

Optional retriever tags for search/filters.

display_config
DisplayConfig · object

Display configuration for public retriever UI rendering (OPTIONAL). Defines how the search interface should appear when the retriever is published, including input fields, theme, layout, exposed result fields, and field formatting. This configuration is used as the default when publishing the retriever.

Example:
{
"components": {
"result_card": {
"card_click_action": "viewDetails",
"field_order": ["title", "description", "price"],
"layout": "vertical",
"show_find_similar": true,
"show_thumbnail": true
},
"result_layout": "grid",
"show_hero": true,
"show_results_header": true,
"show_search": true
},
"custom_cta": {
"label": "Search Tips",
"markdown_content": "# Search Tips\n\n- Use quotes for exact phrases\n- Try descriptive terms"
},
"description": "Search through our product catalog",
"exposed_fields": [
"title",
"description",
"price",
"image_url"
],
"field_config": {
"price": {
"format": "number",
"format_options": {
"decimals": 2,
"label": "Price",
"prefix": "$"
}
},
"title": {
"format": "text",
"format_options": {
"label": "Product Name",
"truncate_chars": 60
}
}
},
"field_mappings": {
"thumbnail": "image_url",
"title": "title"
},
"inputs": [
{
"field_name": "query",
"field_schema": {
"description": "Search query",
"examples": ["wireless headphones", "laptop"],
"type": "string"
},
"input_type": "text",
"label": "Search Products",
"order": 0,
"placeholder": "What are you looking for?",
"required": true
}
],
"layout": {
"columns": 3,
"gap": "16px",
"mode": "grid"
},
"logo_url": "https://example.com/logo.png",
"markdowns": [
{
"content": "# AI-Powered Product Search\n\nOur search uses **machine learning** to understand your queries and find the most relevant products.\n\n## Features\n\n- **Semantic Search**: Understands meaning, not just keywords\n- **Visual Search**: Upload images to find similar products\n- **Smart Filters**: Automatically suggests relevant filters",
"title": "How it Works"
},
{
"content": "## Tips for Better Results\n\n1. Use descriptive terms (e.g., \"wireless noise-canceling headphones\")\n2. Try different keywords if you don't find what you're looking for\n3. Use filters to narrow down results\n\n*Happy searching!*",
"title": "Search Guide"
}
],
"template_type": "media-search",
"theme": {
"border_radius": "12px",
"card_style": "elevated",
"font_family": "Inter, sans-serif",
"primary_color": "#007AFF"
},
"title": "Product Search"
}

Response

Successful Response

Response after creating a retriever.

retriever
RetrieverConfig · object
required

Created retriever configuration.

Example:
{
"budget_limits": { "max_credits": 100, "max_time_ms": 60000 },
"collection_ids": ["col_marketing_ads"],
"input_schema": {
"query_text": {
"description": "Full-text query",
"type": "string"
}
},
"retriever_id": "ret_abc123",
"retriever_name": "executive_ads_search",
"stages": [
{
"config": {
"parameters": {
"field": "metadata.spend",
"operator": "gt",
"value": 1000
},
"stage_name": "attribute_filter",
"version": "v1"
},
"name": "filter_high_spend",
"stage_type": "filter"
}
]
}