← Developers

ANRAK Agent, headless

Tools & background runs

Everything the AnrakLegal agent can do, from your own code.

1. Tools

One tool per capability: case law and statutes, court records, matters, documents, moot court, filing packs, mindmaps, redaction, e-sign, missions and more. These are the same tools the MCP connector exposes. Tools that take an action argument expose several operations. Your API key needs each tool's scope (set it on the key in the console).

curl https://anrak.legal/api/v1/tools \
  -H "x-api-key: $ANRAK_API_KEY"
curl https://anrak.legal/api/v1/tools/search_statutes \
  -H "x-api-key: $ANRAK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "anticipatory bail", "act": "BNSS"}'

2. Background runs

Some calls take minutes, longer than one HTTP request should stay open. Start them as a run, then poll it. The run uses the same tool, arguments and scopes as a direct call. When it is done you get a markdown summary, the full structured result, and a link to the page in AnrakLegal where the result lives.

curl https://anrak.legal/api/v1/agent/runs \
  -H "x-api-key: $ANRAK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "matter_operations",
    "title": "Mindmap for Sharma v. State",
    "args": { "action": "run", "case_id": "<case id>", "operation": "mindmap" }
  }'
# → 202 { "runId": "cm…", "status": "queued", "poll_url": "/api/v1/agent/runs/cm…" }
curl https://anrak.legal/api/v1/agent/runs/<runId> \
  -H "x-api-key: $ANRAK_API_KEY"
# → { "id": "cm…", "tool": "matter_operations", "status": "done",
#     "summary": "Mindmap ready: 42 nodes, 57 connections",
#     "href": "/paralegal/<case id>?tab=mindmap", "result": { … } }

A run's status is queued, running, done or failed. Poll every few seconds. Polling does not count toward your quota. GET /api/v1/agent/runs lists your recent runs.

ToolActionWhat it does
moot_courtrun_full_debatea full multi-round hearing with the judge's verdict
filing_packgeneratedrafts every document of a trademark, patent or court filing pack
paralegal_mindmapgeneratea judgment mindmap
matter_operationsruna matter's mindmap, case analysis, knowledge graph or dashboard
paralegal_workflowruna multi-step workflow against a matter
paralegal_long_taskdispatchlong research: diligence, memo, timeline

3. OpenAPI

The OpenAPI 3.1 document is generated from the live tool registry, so it always matches what the API serves. It covers every tool with its input schema, background runs and the OpenAI-compatible /api/v1/chat/completions. Long-running actions are marked x-anrak-background-actions, and actions without side effects are marked x-anrak-read-only-actions.

https://anrak.legal/api/v1/openapi.json →
Create an API key →