Skip to content

REST API

The Rust Axum backend exposes a REST API for all corporate operations.

  • Hosted: https://api.thecorporation.ai
  • Local dev: http://localhost:8000

OpenAPI spec:

GET /openapi.json

All requests require a Bearer token — either a JWT (HS256) or an API key (Argon2-hashed, issued via the admin domain).

Terminal window
curl -H "Authorization: Bearer $CORP_TOKEN" \
https://api.thecorporation.ai/v1/entities

Token types:

  • JWT — short-lived, issued via POST /auth/token
  • API key — long-lived, managed via POST /admin/api-keys

API keys carry one or more scopes that restrict what operations they can perform:

ScopeAccess
formation-create / formation-readCreate and read entities
equity-read / equity-writeCap table and round operations
governance-read / governance-writeMeetings, votes, resolutions
treasury-read / treasury-writeInvoices, payments, payroll
contacts-read / contacts-writeStakeholder directory
adminKey management, user admin
allFull access (superuser)
DomainBase pathDescription
Formation/formationEntity creation, structure, documents
Equity/equityCap table, rounds, conversions, SAFEs
Governance/governanceMeetings, votes, board actions
Treasury/treasuryInvoices, payments, payroll, bank accounts
Execution/executionIntents, receipts, async mutation lifecycle
Contacts/contactsStakeholder and signer directory
Agents/agentsAutonomous agent definitions and runs
Work Items/work_itemsTasks and tracked work
Services/servicesIntegrations and external service configs
Admin/adminAPI keys, users, workspace settings

Mutations that require authorization flow through typed intents:

POST /execution/intents
POST /execution/intents/{intent_id}/evaluate
POST /execution/intents/{intent_id}/authorize
POST /execution/intents/{intent_id}/execute
GET /execution/receipts/{receipt_id}

Idempotency is enforced with an Idempotency-Key header on execute requests.

Terminal window
# List entities
curl -H "Authorization: Bearer $CORP_TOKEN" \
https://api.thecorporation.ai/v1/entities
# Create an entity
curl -X POST \
-H "Authorization: Bearer $CORP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"legal_name":"Acme Corp","entity_type":"c_corp","jurisdiction":"DE"}' \
https://api.thecorporation.ai/v1/entities
# Get cap table
curl -H "Authorization: Bearer $CORP_TOKEN" \
https://api.thecorporation.ai/v1/entities/{entity_id}/cap-table
# List governance meetings
curl -H "Authorization: Bearer $CORP_TOKEN" \
https://api.thecorporation.ai/v1/entities/{entity_id}/governance/meetings

The server supports two storage backends, configured at startup:

  • git (default) — every mutation is a git commit; full audit log is the repository history
  • kv + s3 — Redis for hot state, S3 for document blobs; suited for high-write workloads

See Self-Hosting for backend configuration details.

See API Endpoints for the full generated endpoint inventory.