curl --request POST \
--url https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch \
--header 'Authorization: Bearer <token>' \
--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
}
}
]
}
'import requests
url = "https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch"
payload = { "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
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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}
}
]
})
};
fetch('https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch"
payload := strings.NewReader("{\n \"objects\": [\n {\n \"blobs\": [\n {\n \"data\": {\n \"num_pages\": 5,\n \"title\": \"Service Agreement 2024\"\n },\n \"key_prefix\": \"/contract-2024/content.pdf\",\n \"metadata\": {\n \"author\": \"John Doe\",\n \"department\": \"Legal\"\n },\n \"property\": \"content\",\n \"type\": \"json\"\n },\n {\n \"data\": {\n \"filename\": \"https://example.com/images/smartphone-x1.jpg\",\n \"mime_type\": \"image/jpeg\"\n },\n \"key_prefix\": \"/contract-2024/thumbnail.jpg\",\n \"metadata\": {\n \"height\": 300,\n \"width\": 200\n },\n \"property\": \"thumbnail\",\n \"type\": \"image\"\n }\n ],\n \"key_prefix\": \"/documents\",\n \"metadata\": {\n \"category\": \"contracts\",\n \"status\": \"draft\",\n \"year\": 2024\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"objects\": [\n {\n \"blobs\": [\n {\n \"data\": {\n \"num_pages\": 5,\n \"title\": \"Service Agreement 2024\"\n },\n \"key_prefix\": \"/contract-2024/content.pdf\",\n \"metadata\": {\n \"author\": \"John Doe\",\n \"department\": \"Legal\"\n },\n \"property\": \"content\",\n \"type\": \"json\"\n },\n {\n \"data\": {\n \"filename\": \"https://example.com/images/smartphone-x1.jpg\",\n \"mime_type\": \"image/jpeg\"\n },\n \"key_prefix\": \"/contract-2024/thumbnail.jpg\",\n \"metadata\": {\n \"height\": 300,\n \"width\": 200\n },\n \"property\": \"thumbnail\",\n \"type\": \"image\"\n }\n ],\n \"key_prefix\": \"/documents\",\n \"metadata\": {\n \"category\": \"contracts\",\n \"status\": \"draft\",\n \"year\": 2024\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"objects\": [\n {\n \"blobs\": [\n {\n \"data\": {\n \"num_pages\": 5,\n \"title\": \"Service Agreement 2024\"\n },\n \"key_prefix\": \"/contract-2024/content.pdf\",\n \"metadata\": {\n \"author\": \"John Doe\",\n \"department\": \"Legal\"\n },\n \"property\": \"content\",\n \"type\": \"json\"\n },\n {\n \"data\": {\n \"filename\": \"https://example.com/images/smartphone-x1.jpg\",\n \"mime_type\": \"image/jpeg\"\n },\n \"key_prefix\": \"/contract-2024/thumbnail.jpg\",\n \"metadata\": {\n \"height\": 300,\n \"width\": 200\n },\n \"property\": \"thumbnail\",\n \"type\": \"image\"\n }\n ],\n \"key_prefix\": \"/documents\",\n \"metadata\": {\n \"category\": \"contracts\",\n \"status\": \"draft\",\n \"year\": 2024\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"succeeded": [
{
"bucket_id": "<string>",
"object_id": "<string>",
"key_prefix": "<string>",
"blobs": [
{
"property": "<string>",
"blob_id": "<string>",
"key_prefix": "/videos/video.mp4",
"properties": {},
"presigned_url": "<string>",
"details": {
"filename": "<string>",
"size_bytes": 123,
"mime_type": "<string>",
"hash": "<string>"
}
}
],
"source_details": [
{
"source_id": "<string>"
}
],
"edges": [
{
"type": "<string>",
"target_object_id": "<string>",
"target_collection_id": "<string>",
"direction": "out",
"attributes": {}
}
],
"status": "DRAFT",
"error": "Failed to process object: Object not found",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"document_count": 123,
"consistency": {
"retriever_visible": "<string>",
"recommended_header": "<string>",
"write_token_available": false,
"expected_visible_within_ms": 123,
"poll": {},
"next_actions": [
{}
]
}
}
],
"failed": [
{
"object_index": 123,
"error": "<string>",
"error_type": "<string>"
}
],
"total_requested": 123,
"succeeded_count": 123,
"failed_count": 123
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}Create Objects in Batch
This endpoint creates multiple new objects in the specified bucket as a batch. Each object must conform to the bucket’s schema.
Processing: By default, objects are created in DRAFT status and require
batch submission for processing. Set auto_process=true to automatically
create a processing batch and submit it (zero-touch workflow).
Partial Success: This endpoint uses partial success - valid objects are created even if some fail validation. Failed objects are returned separately with error details, allowing you to fix and retry only the failed ones.
Response: Returns both succeeded and failed objects. The batch succeeds (200 OK) as long
as at least one object is created. Check the failed array for objects that need attention.
curl --request POST \
--url https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch \
--header 'Authorization: Bearer <token>' \
--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
}
}
]
}
'import requests
url = "https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch"
payload = { "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
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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}
}
]
})
};
fetch('https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch"
payload := strings.NewReader("{\n \"objects\": [\n {\n \"blobs\": [\n {\n \"data\": {\n \"num_pages\": 5,\n \"title\": \"Service Agreement 2024\"\n },\n \"key_prefix\": \"/contract-2024/content.pdf\",\n \"metadata\": {\n \"author\": \"John Doe\",\n \"department\": \"Legal\"\n },\n \"property\": \"content\",\n \"type\": \"json\"\n },\n {\n \"data\": {\n \"filename\": \"https://example.com/images/smartphone-x1.jpg\",\n \"mime_type\": \"image/jpeg\"\n },\n \"key_prefix\": \"/contract-2024/thumbnail.jpg\",\n \"metadata\": {\n \"height\": 300,\n \"width\": 200\n },\n \"property\": \"thumbnail\",\n \"type\": \"image\"\n }\n ],\n \"key_prefix\": \"/documents\",\n \"metadata\": {\n \"category\": \"contracts\",\n \"status\": \"draft\",\n \"year\": 2024\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"objects\": [\n {\n \"blobs\": [\n {\n \"data\": {\n \"num_pages\": 5,\n \"title\": \"Service Agreement 2024\"\n },\n \"key_prefix\": \"/contract-2024/content.pdf\",\n \"metadata\": {\n \"author\": \"John Doe\",\n \"department\": \"Legal\"\n },\n \"property\": \"content\",\n \"type\": \"json\"\n },\n {\n \"data\": {\n \"filename\": \"https://example.com/images/smartphone-x1.jpg\",\n \"mime_type\": \"image/jpeg\"\n },\n \"key_prefix\": \"/contract-2024/thumbnail.jpg\",\n \"metadata\": {\n \"height\": 300,\n \"width\": 200\n },\n \"property\": \"thumbnail\",\n \"type\": \"image\"\n }\n ],\n \"key_prefix\": \"/documents\",\n \"metadata\": {\n \"category\": \"contracts\",\n \"status\": \"draft\",\n \"year\": 2024\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/buckets/{bucket_identifier}/objects/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"objects\": [\n {\n \"blobs\": [\n {\n \"data\": {\n \"num_pages\": 5,\n \"title\": \"Service Agreement 2024\"\n },\n \"key_prefix\": \"/contract-2024/content.pdf\",\n \"metadata\": {\n \"author\": \"John Doe\",\n \"department\": \"Legal\"\n },\n \"property\": \"content\",\n \"type\": \"json\"\n },\n {\n \"data\": {\n \"filename\": \"https://example.com/images/smartphone-x1.jpg\",\n \"mime_type\": \"image/jpeg\"\n },\n \"key_prefix\": \"/contract-2024/thumbnail.jpg\",\n \"metadata\": {\n \"height\": 300,\n \"width\": 200\n },\n \"property\": \"thumbnail\",\n \"type\": \"image\"\n }\n ],\n \"key_prefix\": \"/documents\",\n \"metadata\": {\n \"category\": \"contracts\",\n \"status\": \"draft\",\n \"year\": 2024\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"succeeded": [
{
"bucket_id": "<string>",
"object_id": "<string>",
"key_prefix": "<string>",
"blobs": [
{
"property": "<string>",
"blob_id": "<string>",
"key_prefix": "/videos/video.mp4",
"properties": {},
"presigned_url": "<string>",
"details": {
"filename": "<string>",
"size_bytes": 123,
"mime_type": "<string>",
"hash": "<string>"
}
}
],
"source_details": [
{
"source_id": "<string>"
}
],
"edges": [
{
"type": "<string>",
"target_object_id": "<string>",
"target_collection_id": "<string>",
"direction": "out",
"attributes": {}
}
],
"status": "DRAFT",
"error": "Failed to process object: Object not found",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"document_count": 123,
"consistency": {
"retriever_visible": "<string>",
"recommended_header": "<string>",
"write_token_available": false,
"expected_visible_within_ms": 123,
"poll": {},
"next_actions": [
{}
]
}
}
],
"failed": [
{
"object_index": 123,
"error": "<string>",
"error_type": "<string>"
}
],
"total_requested": 123,
"succeeded_count": 123,
"failed_count": 123
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the bucket.
Query Parameters
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
Request model for creating multiple bucket objects in a batch.
List of objects to be created in this batch (max 100).
100Show child attributes
Show child attributes
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.
List of successfully created objects
Show child attributes
Show child attributes
List of objects that failed to create with error details
Show child attributes
Show child attributes
Total number of objects in the batch request
Number of objects successfully created
Number of objects that failed
Was this page helpful?

