> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dabarai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create politics

> Create a new politics

## Headers

<ParamField header="api-token" type="string" required />

## Body

<ParamField body="name" type="string" required>
  Display name.
</ParamField>

<ParamField body="description" type="string" required>
  What the politics is meant to analyze / enforce.
</ParamField>

<ParamField body="rules" type="Rule[]" required>
  Non-empty array. Each rule must provide `name` and `description`.

  <Expandable title="Rule">
    <ParamField body="name" type="string" required />

    <ParamField body="description" type="string" required />
  </Expandable>
</ParamField>

<ParamField body="knowledgeFiles" type="File[]">
  Optional reference documents. `type` must be `"word"` or `"pdf"`; `url` must
  be a publicly reachable `http(s)` link (no S3 upload is performed).

  <Expandable title="File">
    <ParamField body="url" type="string" required>Public http(s) URL.</ParamField>
    <ParamField body="type" type="string" required>`word` or `pdf`</ParamField>

    <ParamField body="name" type="string" required />

    <ParamField body="size" type="number">Bytes.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="contactNotifications" type="string[]">
  Emails or identifiers to notify when this politics produces a result.
</ParamField>

<ParamField body="outputFormat" type="object">
  Free-form JSON describing the desired shape of results.
</ParamField>

## Response — `201 Created`

<ResponseField name="success" type="boolean" />

<ResponseField name="message" type="string" />

<ResponseField name="data" type="Politics">
  The full persisted document, including `_id`, `userId`, `status` (1),
  `createdAt`, and `updatedAt`.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  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"]
    }'
  ```
</RequestExample>
