Skip to main content
POST
/
v1
/
collections
/
{collection_identifier}
/
clone
Clone Collection
curl --request POST \
  --url https://api.mixpeek.com/v1/collections/{collection_identifier}/clone \
  --header 'Content-Type: application/json' \
  --data '
{
  "collection_name": "<string>",
  "description": "Cloned from product_embeddings with CLIP v2",
  "source": {
    "bucket_ids": [
      "bkt_marketing_videos"
    ],
    "description": "Single bucket source",
    "type": "bucket"
  },
  "feature_extractor": {
    "description": "Text extractor with field passthrough",
    "feature_extractor_name": "text_extractor",
    "field_passthrough": [
      {
        "required": true,
        "source_path": "title"
      },
      {
        "source_path": "author"
      }
    ],
    "input_mappings": {
      "text": "content"
    },
    "parameters": {
      "model": "text-embedding-3-small"
    },
    "version": "v1"
  },
  "enabled": true,
  "metadata": {},
  "taxonomy_applications": [
    {
      "taxonomy_id": "<string>",
      "execution_mode": "on_demand",
      "target_collection_id": "<string>",
      "scroll_filters": {
        "AND": [
          {
            "field": "name",
            "operator": "eq",
            "value": "John"
          },
          {
            "field": "age",
            "operator": "gte",
            "value": 30
          }
        ],
        "OR": [
          {
            "field": "status",
            "operator": "eq",
            "value": "active"
          },
          {
            "field": "role",
            "operator": "eq",
            "value": "admin"
          }
        ],
        "NOT": [
          {
            "field": "department",
            "operator": "eq",
            "value": "HR"
          },
          {
            "field": "location",
            "operator": "eq",
            "value": "remote"
          }
        ],
        "case_sensitive": true
      }
    }
  ]
}
'
{
  "collection": {
    "collection_name": "<string>",
    "input_schema": {
      "properties": {}
    },
    "output_schema": {
      "properties": {}
    },
    "feature_extractor": {
      "feature_extractor_name": "<string>",
      "version": "<string>",
      "feature_extractor_id": "<string>",
      "parameters": {},
      "input_mappings": {
        "image": "product_image",
        "text": "title"
      },
      "field_passthrough": [
        {
          "source_path": "<string>",
          "target_path": "title",
          "default": "Unknown",
          "required": false
        }
      ],
      "include_all_source_fields": false
    },
    "source": {
      "type": "bucket",
      "bucket_ids": [
        "bkt_marketing_videos"
      ],
      "collection_id": "col_video_frames",
      "collection_ids": [
        "col_us_products",
        "col_eu_products"
      ],
      "inherited_bucket_ids": [
        "bkt_marketing_videos"
      ],
      "source_filters": {
        "description": "Filter only video content",
        "filters": {
          "AND": [
            {
              "field": "blobs.type",
              "operator": "eq",
              "value": "video"
            }
          ]
        }
      }
    },
    "collection_id": "<string>",
    "description": "Video frames extracted at 1 FPS with CLIP embeddings",
    "source_bucket_schemas": null,
    "source_lineage": [
      {
        "source_config": {
          "type": "bucket",
          "bucket_ids": [
            "bkt_marketing_videos"
          ],
          "collection_id": "col_video_frames",
          "collection_ids": [
            "col_us_products",
            "col_eu_products"
          ],
          "inherited_bucket_ids": [
            "bkt_marketing_videos"
          ],
          "source_filters": {
            "description": "Filter only video content",
            "filters": {
              "AND": [
                {
                  "field": "blobs.type",
                  "operator": "eq",
                  "value": "video"
                }
              ]
            }
          }
        },
        "feature_extractor": {
          "feature_extractor_name": "<string>",
          "version": "<string>",
          "feature_extractor_id": "<string>",
          "parameters": {},
          "input_mappings": {
            "image": "product_image",
            "text": "title"
          },
          "field_passthrough": [
            {
              "source_path": "<string>",
              "target_path": "title",
              "default": "Unknown",
              "required": false
            }
          ],
          "include_all_source_fields": false
        },
        "output_schema": {
          "properties": {}
        }
      }
    ],
    "vector_indexes": [
      "<unknown>"
    ],
    "payload_indexes": [
      "<unknown>"
    ],
    "enabled": true,
    "metadata": {
      "environment": "production",
      "project": "Q4_campaign",
      "team": "data-science"
    },
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "document_count": 0,
    "schema_version": 1,
    "last_schema_sync": "2023-11-07T05:31:56Z",
    "schema_sync_enabled": true,
    "taxonomy_applications": null,
    "cluster_applications": null
  },
  "source_collection_id": "<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.

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'

Path Parameters

collection_identifier
string
required

Source collection ID or name to clone.

Body

application/json

Request to clone a collection with optional modifications.

Purpose: Cloning creates a NEW collection (with new ID) based on an existing one, allowing you to make changes that aren't allowed via PATCH (source, feature_extractor, field_passthrough). This is the recommended way to iterate on collection designs.

Clone vs Template vs Version:

  • Clone: Copy THIS collection and modify it (for iteration/fixes)
  • Template: Create collection from a reusable pattern (for new projects)
  • Version: (Not implemented) - Use clone instead

Use Cases:

  • Change feature extractor configuration without breaking production
  • Modify field_passthrough to include/exclude fields
  • Switch to different source (bucket or collection)
  • Test modifications before replacing production collection
  • Create variants (e.g., different embedding models)

All fields are OPTIONAL:

  • Omit a field to keep the original value
  • Provide a field to override the original value
  • collection_name is REQUIRED (clones must have unique names)
collection_name
string
required

REQUIRED. Name for the cloned collection. Must be unique and different from the source collection.

Minimum string length: 1
description
string | null

OPTIONAL. Description override. If omitted, copies from source collection.

Example:

"Cloned from product_embeddings with CLIP v2"

source
SourceConfig · object

OPTIONAL. Override source configuration. If omitted, copies from source collection. Allows switching between buckets or collections.

Example:
{
"bucket_ids": ["bkt_marketing_videos"],
"description": "Single bucket source",
"type": "bucket"
}
feature_extractor
FeatureExtractorConfig · object

OPTIONAL. Override feature extractor configuration. If omitted, copies from source collection. This is where you'd change models, parameters, or field_passthrough.

Example:
{
"description": "Text extractor with field passthrough",
"feature_extractor_name": "text_extractor",
"field_passthrough": [
{ "required": true, "source_path": "title" },
{ "source_path": "author" }
],
"input_mappings": { "text": "content" },
"parameters": { "model": "text-embedding-3-small" },
"version": "v1"
}
enabled
boolean | null

OPTIONAL. Override enabled status. If omitted, copies from source collection.

metadata
Metadata · object

OPTIONAL. Override metadata. If omitted, copies from source collection.

taxonomy_applications
TaxonomyApplicationConfig · object[] | null

OPTIONAL. Override taxonomy applications. If omitted, copies from source collection.

Response

Successful Response

Response after cloning a collection.

collection
CollectionModel · object
required

Cloned collection configuration with new collection_id.

source_collection_id
string
required

ID of the source collection that was cloned.