Update a record
curl --request PATCH \
--url https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/data/{record_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_name": "Laptop Pro 16",
"price": 2199.9,
"stock": 42,
"active": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({product_name: 'Laptop Pro 16', price: 2199.9, stock: 42, active: true})
};
fetch('https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/data/{record_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/data/{record_id}"
payload = {
"product_name": "Laptop Pro 16",
"price": 2199.9,
"stock": 42,
"active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"updated_count": 123,
"matched_count": 123
}{
"error": "InvalidArguments",
"message": "<string>"
}Records
Update a record
Updates the record’s fields. System fields (_id, created_at,
ownership metadata) are protected and stripped from the payload.
PATCH
/
v1
/
collections
/
{collection_id}
/
data
/
{record_id}
Update a record
curl --request PATCH \
--url https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/data/{record_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_name": "Laptop Pro 16",
"price": 2199.9,
"stock": 42,
"active": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({product_name: 'Laptop Pro 16', price: 2199.9, stock: 42, active: true})
};
fetch('https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/data/{record_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/data/{record_id}"
payload = {
"product_name": "Laptop Pro 16",
"price": 2199.9,
"stock": 42,
"active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"updated_count": 123,
"matched_count": 123
}{
"error": "InvalidArguments",
"message": "<string>"
}Authorizations
BearerAuthOrgApiKeyAuth
User session JWT. Send as Authorization: Bearer <token>.
Path Parameters
Collection identifier returned at creation.
Record identifier (_id).
Body
application/json
Record fields matching the collection schema. Unknown fields are accepted (flexible schema); system fields are ignored.
Was this page helpful?