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' \
  --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": {
    "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 | null

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. Example: 'Bearer sk_1234567890abcdef'

X-Namespace
string | null

Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.

Body

application/json

Request model for creating a new bucket.

CRITICAL: Define a bucket_schema if you plan to create collections that process this bucket's data.

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

Without a bucket_schema, you can still store objects, but collections won't be able to use input_mappings to reference your custom fields.

bucket_name
string
required

Human-readable name for the bucket

description
string | null

Description of the bucket

bucket_schema
object | null

Schema definition for objects in this bucket. REQUIRED if you want collections to use input_mappings. Defines the custom fields your objects will have (blob properties, metadata structure, etc.) 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

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.