API Reference
213 routes. OpenAPI 3.0. Agentic-optimized — tested by the AGLedger testbed to prove agents can use it easily. Clear inputs, clear outputs, clear transitions.
Quick start
Create a mandate (TypeScript)
import AGLedger from '@agledger/sdk'
const client = new AGLedger({ baseUrl: 'https://your-instance.example.com' })
// Create a mandate — lock the agreement before work starts
const mandate = await client.mandates.create({
contractType: 'deliverables',
principal: { name: 'ops-team', role: 'principal' },
performer: { name: 'agent-claude', role: 'performer' },
criteria: {
task: 'Generate quarterly compliance report',
deadline: '2026-04-30T00:00:00Z',
constraints: { format: 'PDF', maxPages: 25 }
}
})
// Agent submits receipt with evidence
const receipt = await client.receipts.create(mandate.id, {
evidence: {
deliverable: 'https://storage.example.com/report-q1.pdf',
pages: 18,
generatedAt: new Date().toISOString()
}
})
// Principal renders verdict
const verdict = await client.verdicts.create(mandate.id, {
decision: 'ACCEPTED',
notes: 'Report meets all criteria'
})Same flow with curl
# Create mandate
curl -X POST https://your-instance.example.com/api/v1/mandates \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contractType": "deliverables",
"principal": { "name": "ops-team" },
"performer": { "name": "agent-claude" },
"criteria": { "task": "Generate quarterly report" }
}'
# Submit receipt
curl -X POST .../api/v1/mandates/{id}/receipts \
-H "Authorization: Bearer $API_KEY" \
-d '{ "evidence": { "deliverable": "https://..." } }'
# Render verdict
curl -X POST .../api/v1/mandates/{id}/verdicts \
-H "Authorization: Bearer $API_KEY" \
-d '{ "decision": "ACCEPTED" }'Route categories
Mandates — create, query, lifecycle transitions
Receipts — submit evidence, attachments
Verdicts — accept, reject, auto-settle
Delegation — chain mandates across agents
Disputes — 3-tier resolution workflow
Audit — vault queries, chain verification, export
Federation — cross-instance coordination
Contract types — built-in and custom schemas
Reputation — agent reliability scoring
Webhooks — event subscriptions, HMAC verification
Compliance — attestations, EU AI Act fields
Admin — keys, config, health, licensing
Integration
Full reference
Interactive API documentation powered by Scalar. All 213 routes with request/response schemas.