---
title: "Instantiate Scaffold Template"
method: POST
path: "/v1/templates/scaffolds/{template_id}/instantiate"
tags: ["Scaffold Templates"]
---

# Instantiate Scaffold Template

`POST /v1/templates/scaffolds/{template_id}/instantiate`

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"
}
```

## Path parameters

- `template_id` string, required — Scaffold template ID

## Request body

- InstantiateScaffoldRequest — 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}
  - `namespace_name` string, required — Name for the new namespace (required, must be unique)
  - `namespace_description` string, nullable — Optional description for the namespace
  - `bucket_name` string, nullable — Override default bucket name from scaffold
  - `collection_name` string, nullable — Override default collection name from scaffold
  - `retriever_name` string, nullable — Override default retriever name from scaffold
  - `include_sample_data` boolean — If true, include sample data from demo namespace. If false, create empty resources.

## Response `201`

Successful Response

- InstantiatedScaffoldResponse — 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
  - `namespace_id` string, required — Created namespace ID (ns_xxx)
  - `namespace_name` string, required — Created namespace name
  - `bucket_id` string, required — Created bucket ID (bkt_xxx)
  - `bucket_name` string, required — Created bucket name
  - `collection_id` string, required — Created collection ID (col_xxx)
  - `collection_name` string, required — Created collection name
  - `retriever_id` string, required — Created retriever ID (ret_xxx)
  - `retriever_name` string, required — Created retriever name
  - `template_id` string, required — Scaffold template ID used
  - `status` string — Status: 'created' for a synchronous (empty) instantiation, 'cloning' when sample data is cloning in the background
  - `task_id` string, nullable — 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` string, date-time — UTC timestamp of creation

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/mixpeek/apis/mixpeek-api.md) · [All operations](https://skmtc.net/mixpeek/apis/mixpeek-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mixpeek/mixpeek-api/revisions/5307993e44d3/schema)
