Skip to main content
POST
/
politics
curl -X POST "https://api.dabarai.com/v1/politics" \
  -H "api-token: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "BP Rules",
    "description": "Analyze compliance documents",
    "rules": [
      { "name": "Scope", "description": "Only loans > 10k" },
      { "name": "Tone", "description": "Formal" }
    ],
    "knowledgeFiles": [
      { "url": "https://cdn.example.com/policy.pdf", "type": "pdf", "name": "policy.pdf" }
    ],
    "contactNotifications": ["ops@example.com"]
  }'
{
  "success": true,
  "message": "<string>",
  "data": {}
}

Headers

api-token
string
required

Body

name
string
required
Display name.
description
string
required
What the politics is meant to analyze / enforce.
rules
Rule[]
required
Non-empty array. Each rule must provide name and description.
knowledgeFiles
File[]
Optional reference documents. type must be "word" or "pdf"; url must be a publicly reachable http(s) link (no S3 upload is performed).
contactNotifications
string[]
Emails or identifiers to notify when this politics produces a result.
outputFormat
object
Free-form JSON describing the desired shape of results.

Response — 201 Created

success
boolean
message
string
data
Politics
The full persisted document, including _id, userId, status (1), createdAt, and updatedAt.
curl -X POST "https://api.dabarai.com/v1/politics" \
  -H "api-token: YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "BP Rules",
    "description": "Analyze compliance documents",
    "rules": [
      { "name": "Scope", "description": "Only loans > 10k" },
      { "name": "Tone", "description": "Formal" }
    ],
    "knowledgeFiles": [
      { "url": "https://cdn.example.com/policy.pdf", "type": "pdf", "name": "policy.pdf" }
    ],
    "contactNotifications": ["ops@example.com"]
  }'