Skip to main content
POST
/
v1
/
buckets
Create Bucket
curl --request POST \
  --url https://api.mixpeek.com/v1/buckets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Namespace: <x-namespace>' \
  --data '{
  "bucket_name": "product_images",
  "bucket_schema": {
    "properties": {
      "image": {
        "description": "Product image blob",
        "type": "image"
      },
      "metadata": {
        "description": "Product information",
        "properties": {
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "price": {
            "type": "float"
          }
        },
        "type": "object"
      }
    }
  },
  "description": "Product images with metadata for e-commerce",
  "metadata": {
    "department": "Sales",
    "region": "US"
  }
}'
{
  "bucket_id": "<string>",
  "bucket_name": "<string>",
  "description": "<string>",
  "bucket_schema": {
    "properties": {}
  },
  "metadata": {},
  "object_count": 123,
  "total_size_bytes": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "last_upload_at": "2023-11-07T05:31:56Z",
  "status": "ACTIVE",
  "is_locked": false,
  "batch_stats": {
    "total": 0,
    "active": 0,
    "completed": 0,
    "failed": 0
  },
  "storage_stats": {
    "total_size_bytes": 0,
    "avg_size_bytes": 0,
    "max_size_bytes": 0,
    "min_size_bytes": 0
  }
}

Authorizations

Authorization
string
header
required

Bearer token authentication using your API key. Format: 'Bearer your_api_key'. To get an API key, create an account at mixpeek.com/start and generate a key in your account settings.

Headers

Authorization
string
required

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 sk_live_abc123def456"

"Bearer sk_test_xyz789"

X-Namespace
string
required

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

Request model for creating a new bucket.

REQUIRED: A bucket_schema must be defined to enable data processing and validation.

The bucket_schema tells the system what fields your objects will have, enabling:

  • Collections to map your data fields to feature extractors via input_mappings
  • Validation of object structure at upload time
  • Type-safe data pipelines from bucket → collection → retrieval

Every bucket must have a schema that defines the structure of objects it will contain.

bucket_name
string
required

Human-readable name for the bucket

bucket_schema
object
required

Schema definition for objects in this bucket (REQUIRED). Defines the custom fields your objects will have (blob properties, metadata structure, etc.)

description
string | null

Description of the bucket

metadata
object

Additional metadata for the bucket

Response

Successful Response

Response model for bucket operations.

bucket_name
string
required

Human-readable name for the bucket

object_count
integer
required

Number of objects in the bucket

total_size_bytes
integer
required

Total size of all objects in the bucket in bytes

bucket_id
string

Unique identifier for the bucket

description
string | null

Description of the bucket

bucket_schema
object | null

Schema definition for objects in this bucket Schema definition for bucket objects.

IMPORTANT: The bucket schema defines what fields your bucket objects will have. This schema is REQUIRED if you want to:

  1. Create collections that use input_mappings to process your bucket data
  2. Validate object structure before ingestion
  3. Enable type-safe data pipelines

The schema defines the custom fields that will be used in:

  • Blob properties (e.g., "content", "thumbnail", "transcript")
  • Object metadata structure
  • Blob data structures

Example workflow:

  1. Create bucket WITH schema defining your data structure
  2. Upload objects that conform to that schema
  3. Create collections that map schema fields to feature extractors

Without a bucket_schema, collections cannot use input_mappings.

metadata
object

Additional metadata for the bucket

created_at
string<date-time> | null

When the bucket was created

updated_at
string<date-time> | null

Last modification time of bucket metadata

last_upload_at
string<date-time> | null

When the last object was uploaded to this bucket

status
enum<string>

Bucket lifecycle status (ACTIVE, ARCHIVED, SUSPENDED, IN_PROGRESS for deleting)

Available options:
PENDING,
IN_PROGRESS,
PROCESSING,
COMPLETED,
FAILED,
CANCELED,
UNKNOWN,
SKIPPED,
DRAFT,
ACTIVE,
ARCHIVED,
SUSPENDED
is_locked
boolean
default:false

Whether the bucket is locked (read-only)

batch_stats
object | null

Batch statistics for this bucket (calculated asynchronously, stored in DB) Statistics about batches in a bucket.

storage_stats
object | null

Storage statistics for this bucket (calculated asynchronously, stored in DB) Statistics about object storage in a bucket.