Update document
info
- client write secret is required for adding, modifying, or deleting data.
Overview
Path
PUT / PATCH/v1/collections/{collectionName}/documents/{docId}
- Update a single Document.
- PATCH request updates only the specified fields, leaving the rest unchanged.
- PUT request performs a destructive update, clearing all unspecified cell values.
Example
curl -X PUT https://api.invector.co/v1/collections/{collectionName}/documents/{docId} \
-H "Content-Type: application/json" \
-H "Authorization: Basic base64({CLIENT_ID}:{CLIENT_WRITE_SECRET})" \
-d '{
"fields": {
"title": "Description of Philip",
"name": "Philips",
"age": 23,
"department": "Engineering",
"role": "Software Engineer",
"email": "philipchoi@togglecampus.com"
}
}'
curl -X PATCH https://api.invector.co/v1/collections/{collectionName}/documents/{docId} \
-H "Content-Type: application/json" \
-H "Authorization: Basic base64({CLIENT_ID}:{CLIENT_WRITE_SECRET})" \
-d '{
"fields": {
"name": "Philips",
"age": 23,
"email": "philip@togglecampus.com"
}
}'
Authorization
Authorization
BasicBasic authorization at Header. Base64 encoding required
client_id
string
client_secret
string
example
curl -X PUT https://api.invector.co/v1/collections/{collectionName}/documents \
-H "Content-Type: application/json" \
-H "Authorization: Basic base64({CLIENT_ID}:{CLIENT_WRITE_SECRET})" \
...
Path Parameters
collectionName
string
docId
string
Request Body
fields
objectFields to be updated.
field_to_update
anykey value pair to update.
example
{
"fields": {
"name": "Philip",
"age": 22,
"department": "Engineering",
}
}
Response Body
200
objectUpdated Document object
_id
stringUnique Document ID.
title
stringTitle of the document.
[other fields …]
anyOther fields of the document.
example
{
"_id": "unique_document_id_123",
"title": "Description of Philip",
"name": "Philip",
"age": 22,
"department": "Engineering",
"role": "Software Engineer",
"email": "philipchoi@togglecampus.com"
}