curl --request PATCH \
--url https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Namespace: <api-key>' \
--data '
{
"description": "Update all pending documents to processed",
"filters": {
"AND": [
{
"field": "metadata.status",
"operator": "eq",
"value": "pending"
}
]
},
"update_data": {
"metadata": {
"status": "processed"
}
}
}
'import requests
url = "https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk"
payload = {
"description": "Update all pending documents to processed",
"filters": { "AND": [
{
"field": "metadata.status",
"operator": "eq",
"value": "pending"
}
] },
"update_data": { "metadata": { "status": "processed" } }
}
headers = {
"Authorization": "Bearer <token>",
"X-Namespace": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Namespace': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: 'Update all pending documents to processed',
filters: {AND: [{field: 'metadata.status', operator: 'eq', value: 'pending'}]},
update_data: {metadata: {status: 'processed'}}
})
};
fetch('https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk', 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/collections/{collection_identifier}/documents/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Update all pending documents to processed',
'filters' => [
'AND' => [
[
'field' => 'metadata.status',
'operator' => 'eq',
'value' => 'pending'
]
]
],
'update_data' => [
'metadata' => [
'status' => 'processed'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Namespace: <api-key>"
],
]);
$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/collections/{collection_identifier}/documents/bulk"
payload := strings.NewReader("{\n \"description\": \"Update all pending documents to processed\",\n \"filters\": {\n \"AND\": [\n {\n \"field\": \"metadata.status\",\n \"operator\": \"eq\",\n \"value\": \"pending\"\n }\n ]\n },\n \"update_data\": {\n \"metadata\": {\n \"status\": \"processed\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Namespace", "<api-key>")
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.patch("https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk")
.header("Authorization", "Bearer <token>")
.header("X-Namespace", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Update all pending documents to processed\",\n \"filters\": {\n \"AND\": [\n {\n \"field\": \"metadata.status\",\n \"operator\": \"eq\",\n \"value\": \"pending\"\n }\n ]\n },\n \"update_data\": {\n \"metadata\": {\n \"status\": \"processed\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Namespace"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Update all pending documents to processed\",\n \"filters\": {\n \"AND\": [\n {\n \"field\": \"metadata.status\",\n \"operator\": \"eq\",\n \"value\": \"pending\"\n }\n ]\n },\n \"update_data\": {\n \"metadata\": {\n \"status\": \"processed\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"status": "<string>",
"updated_count": 123,
"message": "Bulk update enqueued"
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Bulk Update Documents
Bulk update documents matching filter conditions.
Partially updates all documents in the collection that match the provided filters. If no filters are provided, updates all documents in the collection.
This endpoint applies the SAME update_data to ALL documents matching the filters. For per-document updates with different values, use POST /batch endpoint instead.
curl --request PATCH \
--url https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Namespace: <api-key>' \
--data '
{
"description": "Update all pending documents to processed",
"filters": {
"AND": [
{
"field": "metadata.status",
"operator": "eq",
"value": "pending"
}
]
},
"update_data": {
"metadata": {
"status": "processed"
}
}
}
'import requests
url = "https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk"
payload = {
"description": "Update all pending documents to processed",
"filters": { "AND": [
{
"field": "metadata.status",
"operator": "eq",
"value": "pending"
}
] },
"update_data": { "metadata": { "status": "processed" } }
}
headers = {
"Authorization": "Bearer <token>",
"X-Namespace": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Namespace': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: 'Update all pending documents to processed',
filters: {AND: [{field: 'metadata.status', operator: 'eq', value: 'pending'}]},
update_data: {metadata: {status: 'processed'}}
})
};
fetch('https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk', 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/collections/{collection_identifier}/documents/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Update all pending documents to processed',
'filters' => [
'AND' => [
[
'field' => 'metadata.status',
'operator' => 'eq',
'value' => 'pending'
]
]
],
'update_data' => [
'metadata' => [
'status' => 'processed'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Namespace: <api-key>"
],
]);
$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/collections/{collection_identifier}/documents/bulk"
payload := strings.NewReader("{\n \"description\": \"Update all pending documents to processed\",\n \"filters\": {\n \"AND\": [\n {\n \"field\": \"metadata.status\",\n \"operator\": \"eq\",\n \"value\": \"pending\"\n }\n ]\n },\n \"update_data\": {\n \"metadata\": {\n \"status\": \"processed\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Namespace", "<api-key>")
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.patch("https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk")
.header("Authorization", "Bearer <token>")
.header("X-Namespace", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Update all pending documents to processed\",\n \"filters\": {\n \"AND\": [\n {\n \"field\": \"metadata.status\",\n \"operator\": \"eq\",\n \"value\": \"pending\"\n }\n ]\n },\n \"update_data\": {\n \"metadata\": {\n \"status\": \"processed\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Namespace"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Update all pending documents to processed\",\n \"filters\": {\n \"AND\": [\n {\n \"field\": \"metadata.status\",\n \"operator\": \"eq\",\n \"value\": \"pending\"\n }\n ]\n },\n \"update_data\": {\n \"metadata\": {\n \"status\": \"processed\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"status": "<string>",
"updated_count": 123,
"message": "Bulk update enqueued"
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Authorizations
Mixpeek API key, sent as Authorization: Bearer mxp_sk_.... Create one in Studio under Settings → API Keys, or with an admin key via POST /v1/organizations/users/{user_email}/api-keys. A missing header returns 403; an invalid or revoked key returns 401.
Namespace id (ns_...), not the namespace name. This scopes the request rather than authenticating it, and it is required on every operation marked x-mixpeek-namespace-scoped.
Path Parameters
The ID of the collection to update documents in.
Body
Request model for bulk updating documents by filters.
Updates ALL documents matching the provided filters with the SAME update_data. For updating specific documents by ID or different values per document, use BatchUpdateDocumentsRequest.
Use Cases: - Update all pending documents to processed - Update all documents from a specific date range - Apply uniform changes across filtered document sets
Requirements: - update_data: REQUIRED - fields to update on all matching documents - filters: OPTIONAL - if omitted, updates ALL documents in collection
REQUIRED. Dictionary of field-value pairs to update on ALL matching documents. Can update any document field except vectors (metadata, source_blobs, etc.). All matched documents receive the SAME updates. Example: {'metadata.status': 'processed', 'metadata.reviewed': true}
{
"metadata": { "reviewed": true, "status": "processed" }
}
{ "metadata.processing_complete": true }
OPTIONAL. Filter conditions to match documents for update. If not provided, updates ALL documents in the collection. Uses the logical AND/OR/NOT shape — a list of {field, operator, value} conditions (operators: eq, ne, in, nin, gt, gte, lt, lte, contains, exists, …). The MVS-native {'must': [{'key': ...}]} shape is NOT accepted here. Example: {'AND': [{'field': 'metadata.status', 'operator': 'eq', 'value': 'pending'}]}
Show child attributes
Show child attributes
{
"AND": [
{
"field": "metadata.status",
"operator": "eq",
"value": "pending"
}
]
}
Response
Successful Response
Response model for bulk document update operation.
bulk update is ASYNC. A filtered update scrolls matches on the shard and can run far longer than a request should hold a connection (an unindexed filtered scroll scans the whole shard, so 172 matching docs on a shared 6.47M-vector shard exceeded 120s and the client saw a silent no-op). The endpoint now enqueues a task and returns immediately: poll GET /v1/tasks/{task_id} for the terminal status and updated_count.
Id of the background task running the bulk update. Poll GET /v1/tasks/{task_id} for status and the final updated_count.
Task status at enqueue time (PENDING). The terminal status (COMPLETED / FAILED) and updated_count land on the task record.
Number of documents updated. Null on the async enqueue response; populated on the task record when the task completes.
Was this page helpful?

