curl -X PATCH "https://api.dabarai.com/v1/politics/69aa51d188c08a82d22fb2d8" \
-H "api-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "BP Rules v2",
"addRules": [{ "name": "R5", "description": "New rule" }]
}'
curl -X PATCH "https://api.dabarai.com/v1/politics/69aa51d188c08a82d22fb2d8" \
-H "api-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "removeRules": [0, 3] }'
curl -X PATCH "https://api.dabarai.com/v1/politics/69aa51d188c08a82d22fb2d8" \
-H "api-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "updateRule": { "index": 1, "description": "Updated" } }'
{
"success": true,
"data": {}
}Politics
Update politics
Update fields by replacement and/or granular array operations
PATCH
/
politics
/
{id}
curl -X PATCH "https://api.dabarai.com/v1/politics/69aa51d188c08a82d22fb2d8" \
-H "api-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "BP Rules v2",
"addRules": [{ "name": "R5", "description": "New rule" }]
}'
curl -X PATCH "https://api.dabarai.com/v1/politics/69aa51d188c08a82d22fb2d8" \
-H "api-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "removeRules": [0, 3] }'
curl -X PATCH "https://api.dabarai.com/v1/politics/69aa51d188c08a82d22fb2d8" \
-H "api-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "updateRule": { "index": 1, "description": "Updated" } }'
{
"success": true,
"data": {}
}The endpoint accepts two kinds of fields in the same body:
- Replacement fields (
name,description,rules,knowledgeFiles,contactNotifications,outputFormat) overwrite the stored value. - Granular operations (
addRules,removeRules,updateRule,addKnowledgeFiles,removeKnowledgeFiles,addContactNotifications,removeContactNotifications) mutate the current array without requiring the client to send the full value.
updatedAt is always refreshed.
Path parameters
string
required
24-character hex ObjectId of the politics.
Headers
string
required
Body — replacement fields
string
string
Rule[]
Must be non-empty when provided.
File[]
Same validation as on create.
string[]
object
Body — granular operations
Rule[]
Append one or more rules to the end of the array.
integer[]
Indices (0-based) of rules to remove.
File[]
integer[]
Indices to remove.
string[]
string[]
Exact string match is used to decide which entries to drop.
Response
boolean
Politics
The updated document.
curl -X PATCH "https://api.dabarai.com/v1/politics/69aa51d188c08a82d22fb2d8" \
-H "api-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "BP Rules v2",
"addRules": [{ "name": "R5", "description": "New rule" }]
}'
curl -X PATCH "https://api.dabarai.com/v1/politics/69aa51d188c08a82d22fb2d8" \
-H "api-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "removeRules": [0, 3] }'
curl -X PATCH "https://api.dabarai.com/v1/politics/69aa51d188c08a82d22fb2d8" \
-H "api-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "updateRule": { "index": 1, "description": "Updated" } }'