Skip to main content
POST
/
v1
/
buckets
/
{bucket_identifier}
/
objects
/
batch
Create Objects in Batch
curl --request POST \
  --url https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch \
  --header 'Content-Type: application/json' \
  --data '
{
  "objects": [
    {
      "blobs": [
        {
          "data": {
            "num_pages": 5,
            "title": "Service Agreement 2024"
          },
          "key_prefix": "/contract-2024/content.pdf",
          "metadata": {
            "author": "John Doe",
            "department": "Legal"
          },
          "property": "content",
          "type": "json"
        },
        {
          "data": {
            "filename": "https://example.com/images/smartphone-x1.jpg",
            "mime_type": "image/jpeg"
          },
          "key_prefix": "/contract-2024/thumbnail.jpg",
          "metadata": {
            "height": 300,
            "width": 200
          },
          "property": "thumbnail",
          "type": "image"
        }
      ],
      "key_prefix": "/documents",
      "metadata": {
        "category": "contracts",
        "status": "draft",
        "year": 2024
      }
    }
  ]
}
'
{
  "succeeded": [
    {
      "bucket_id": "<string>",
      "object_id": "<string>",
      "key_prefix": "<string>",
      "blobs": [
        {
          "property": "<string>",
          "type": "string",
          "blob_id": "<string>",
          "key_prefix": "/videos/video.mp4",
          "properties": {},
          "details": {
            "filename": "<string>",
            "size_bytes": 123,
            "mime_type": "<string>",
            "hash": "<string>"
          }
        }
      ],
      "source_details": [
        {
          "type": "bucket",
          "source_id": "<string>"
        }
      ],
      "status": "DRAFT",
      "error": "Failed to process object: Object not found",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ],
  "failed": [
    {
      "object_index": 123,
      "error": "<string>",
      "error_type": "<string>"
    }
  ],
  "total_requested": 123,
  "succeeded_count": 123,
  "failed_count": 123
}

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.

Examples:

"Bearer YOUR_API_KEY"

"Bearer YOUR_STRIPE_API_KEY"

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

Examples:

"ns_abc123def456"

"production"

"my-namespace"

Path Parameters

bucket_identifier
string
required

The unique identifier of the bucket.

Query Parameters

auto_process
boolean
default:false

Automatically create a batch and submit it for processing. When true, all successfully created objects will be immediately queued for processing without requiring separate batch calls. Ideal for onboarding and bulk upload workflows.

Body

application/json

Request model for creating multiple bucket objects in a batch.

objects
CreateObjectRequest · object[]
required

List of objects to be created in this batch (max 100).

Maximum array length: 100

Response

Successful Response

Response model for batch object creation with partial success support.

This endpoint uses partial success: valid objects are created even if some fail. Failed objects are tracked separately so users can fix and retry them.

succeeded
ObjectResponse · object[]
required

List of successfully created objects

failed
FailedObjectError · object[]
required

List of objects that failed to create with error details

total_requested
integer
required

Total number of objects in the batch request

succeeded_count
integer
required

Number of objects successfully created

failed_count
integer
required

Number of objects that failed