Skip to main content
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" }]
  }'
{
  "success": true,
  "data": {}
}
The endpoint accepts two kinds of fields in the same body:
  1. Replacement fields (name, description, rules, knowledgeFiles, contactNotifications, outputFormat) overwrite the stored value.
  2. Granular operations (addRules, removeRules, updateRule, addKnowledgeFiles, removeKnowledgeFiles, addContactNotifications, removeContactNotifications) mutate the current array without requiring the client to send the full value.
Replacement and granular ops on the same array are applied in that order: first the replacement, then the granular ops. updatedAt is always refreshed.

Path parameters

id
string
required
24-character hex ObjectId of the politics.

Headers

api-token
string
required

Body — replacement fields

name
string
description
string
rules
Rule[]
Must be non-empty when provided.
knowledgeFiles
File[]
Same validation as on create.
contactNotifications
string[]
outputFormat
object

Body — granular operations

addRules
Rule[]
Append one or more rules to the end of the array.
removeRules
integer[]
Indices (0-based) of rules to remove.
updateRule
object
Modify one rule in place.
addKnowledgeFiles
File[]
removeKnowledgeFiles
integer[]
Indices to remove.
addContactNotifications
string[]
removeContactNotifications
string[]
Exact string match is used to decide which entries to drop.

Response

success
boolean
data
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" }]
  }'