POST
/
v1
/
buckets
/
{bucket_identifier}
/
objects
Create Object
curl --request POST \
  --url https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects \
  --header 'Content-Type: application/json' \
  --data '{
  "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
  }
}'
{
  "blobs": [
    {
      "blob_id": "blob_1",
      "data": {
        "num_pages": 5,
        "title": "Service Agreement 2024"
      },
      "key_prefix": "/contract-2024/content.pdf",
      "metadata": {
        "author": "John Doe",
        "department": "Legal"
      },
      "property": "content",
      "type": "PDF"
    }
  ],
  "bucket_id": "bkt_9xy8z7",
  "content_hash": "28a9f5e8...",
  "key_prefix": "/contract-2024",
  "metadata": {
    "category": "contracts",
    "year": 2024
  },
  "object_id": "obj_123abc456def",
  "skip_duplicates": false,
  "status": "DRAFT"
}

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.

Path Parameters

bucket_identifier
string
required

The unique identifier of the bucket.

Body

application/json

Request model for creating a bucket object.

key_prefix
string | null

Storage key/path prefix of the object, this will be used to retrieve the object from the storage. It's at the root of the object.

Example:

"/contract-2024"

blobs
CreateBlobRequest · object[]

List of blobs to be created in this object

Example:
[
{
"data": {
"num_pages": 5,
"title": "Service Agreement 2024"
},
"key_prefix": "/content.pdf",
"metadata": {
"author": "John Doe",
"department": "Legal"
},
"property": "content",
"type": "PDF"
}
]
metadata
object

Additional metadata for the object, this will be appended in all downstream documents of the your connected collections.

Example:
{
"category": "contracts",
"status": "draft",
"year": 2024
}
skip_duplicates
boolean
default:false

Skip duplicate blobs, if a blob with the same hash already exists, it will be skipped.

Response

Successful Response

Response model for bucket objects.

bucket_id
string
required

ID of the bucket this object belongs to

object_id
string

Unique identifier for the object

key_prefix
string | null

Storage key/path of the object, this will be used to retrieve the object from the storage. It is similar to a file path. If not provided, it will be placed in the root of the bucket.

content_hash
string | null

SHA256 hash of the object's content, used for de-duplication.

blobs
BlobModel · object[]

List of blobs contained in this object

metadata
object

Additional metadata for the object, this will be appended in all downstream documents of the your connected collections.

status
enum<string>

The current status of the object.

Available options:
PENDING,
IN_PROGRESS,
PROCESSING,
COMPLETED,
FAILED,
CANCELED,
UNKNOWN,
SKIPPED,
DRAFT
error
string | null

The error message if the object failed to process.

Examples:

"Failed to process object: Object not found"

skip_duplicates
boolean
default:false

Skip duplicate blobs, if a blob with the same hash already exists, it will be skipped.