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": "<string>",
  "bucket_schema": {
    "properties": {}
  },
  "description": "<string>",
  "unique_key": {
    "default_policy": "upsert",
    "description": "Single field, upsert by default (idempotent video ingestion)",
    "fields": [
      "video_id"
    ]
  },
  "metadata": {}
}
'
{
  "bucket_name": "<string>",
  "object_count": 123,
  "total_size_bytes": 123,
  "bucket_id": "<string>",
  "description": "<string>",
  "bucket_schema": {
    "properties": {}
  },
  "unique_key": {
    "default_policy": "upsert",
    "description": "Single field, upsert by default (idempotent video ingestion)",
    "fields": [
      "video_id"
    ]
  },
  "metadata": {},
  "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 authentication header of the form Bearer <token>, where <token> is your auth token.

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

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' 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'

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
BucketSchema · 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

unique_key
UniqueKeyConfig · object

Unique key configuration for this bucket (OPTIONAL). Enables uniqueness enforcement and upsert operations on specified field(s) from the schema. Cannot be changed after bucket creation.

Example:
{
"default_policy": "upsert",
"description": "Single field, upsert by default (idempotent video ingestion)",
"fields": ["video_id"]
}
metadata
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
BucketSchema · object

Schema definition for objects in this bucket

unique_key
UniqueKeyConfig · object

Unique key configuration for this bucket (if configured)

Example:
{
"default_policy": "upsert",
"description": "Single field, upsert by default (idempotent video ingestion)",
"fields": ["video_id"]
}
metadata
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>
default:ACTIVE

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

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

Whether the bucket is locked (read-only)

batch_stats
BatchStatistics · object

Batch statistics for this bucket (calculated asynchronously, stored in DB)

storage_stats
StorageStatistics · object

Storage statistics for this bucket (calculated asynchronously, stored in DB)