Skip to main content
This guide walks you through your first end-to-end DABAR workflow:
  1. Authenticate against the API.
  2. Create a Politic — the policy that governs how DABAR reasons.
  3. Create a Project — a run that applies the politic to your sources.
  4. Deploy the project so DABAR starts producing verified outputs.
You need a DABAR account and an API token. If you don’t have one yet, sign in at dabarai.com and copy your token from the dashboard.

1. Set up your environment

Export your token so the examples below work as-is.
export DABAR_TOKEN="your_api_token_here"
export DABAR_API="https://api.dabarai.com/v1"

2. Verify authentication

List your existing politics to confirm your token works.
curl "$DABAR_API/politics" \
  -H "api-token: $DABAR_TOKEN"
A 200 response with "success": true means you’re ready. A 401 means the header is missing or the token is invalid — see Authentication.

3. Create a Politic

A Politic is a reusable set of rules DABAR must follow when reasoning. It defines what sources are authoritative, what to flag, and how answers should be shaped.
curl -X POST "$DABAR_API/politics" \
  -H "api-token: $DABAR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Credit Risk Policy",
    "description": "Evaluate loan applications against internal risk guidelines.",
    "rules": [
      { "name": "Scope",    "description": "Only loans above 50,000 USD." },
      { "name": "Evidence", "description": "Every finding must cite source + page." },
      { "name": "Labels",   "description": "Use CONFIRMED / NOT FOUND / ESTIMATED." }
    ],
    "knowledgeFiles": [
      {
        "url": "https://cdn.example.com/risk-guidelines.pdf",
        "type": "pdf",
        "name": "risk-guidelines.pdf"
      }
    ]
  }'
Save the _id returned in data._id — you’ll pass it as politicsId in the next step.

4. Create a Project

A Project applies a Politic to a specific set of input files (documents, URLs, audio, video, or raw text).
curl -X POST "$DABAR_API/projects" \
  -H "api-token: $DABAR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Q1 Loan Batch",
    "description": "Risk analysis for Q1 loan applications.",
    "politicsId": "PASTE_POLITIC_ID_HERE",
    "files": [
      { "name": "application-001.pdf", "type": "document", "url": "https://cdn.example.com/application-001.pdf" },
      { "name": "analyst-notes", "type": "text", "content": "Applicant has prior loan history in 2024..." }
    ]
  }'
The project is created in draft status. It won’t run until you deploy it.

5. Deploy the project

curl -X PUT "$DABAR_API/projects/PASTE_PROJECT_ID_HERE" \
  -H "api-token: $DABAR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "status": "deploying" }'
DABAR now ingests your files, reasons under the politic’s rules, and produces verified outputs labeled CONFIRMED, NOT FOUND, or ESTIMATED with source and page-level citations. Poll the project with GET /projects/{id} to track progress.

Next steps

Policy Engine

Learn how to structure rules that DABAR can enforce end-to-end.

Primary Sources

Understand what kinds of sources DABAR accepts and how they’re used.

Autonomous Agents

Turn a deployed project into an agent that takes action in your systems.

API Reference

Every endpoint, parameter, and response in detail.