Aira's backend exposes a REST API under /api/v1 with over 60 route modules and roughly 500 endpoints. This document covers authentication, the main endpoint groups, and the SSE streaming pattern.
Authentication
Five authentication methods:
JWT Bearer tokens
Obtain tokens via /api/v1/auth/login. Include the access token in requests:
Authorization: Bearer <access_token>
- Access tokens expire in 30 minutes
- Refresh tokens expire in 7 days
- Refresh via
POST /api/v1/auth/refresh
API keys
Create API keys via POST /api/v1/auth/api-keys. Include in requests:
X-API-Key: <api_key>
API keys are scoped to a specific project and have configurable permissions and expiry.
Passkeys (WebAuthn/FIDO2)
For browser-based passwordless authentication. Register passkeys, then authenticate with biometrics or hardware keys.
SSO / OIDC
Enterprise single sign-on via OpenID Connect. Aira discovers the IdP configuration from the user's email domain.
Magic links
Passwordless email-based login. A one-time link is sent to the user's email with an optional next_path redirect.
Project scoping
All project-scoped endpoints require the project ID header:
X-Project-Id: <project_uuid>
The server validates that the authenticated user is a member of the specified project. Missing header returns 400, non-member returns 403.
Endpoint groups
Auth (/auth)
Registration, login, token refresh, logout, password reset (OTP-based), email verification, magic links, Google OAuth, SSO/OIDC exchange, API key management, passkey registration/authentication, security activity log.
Projects (/projects)
CRUD for projects. Create, list, get, update, delete. Project membership management. Project brief submission. Project settings.
Sources (/sources)
Add and manage source documents. Upload files, paste text, connect repositories.
Key endpoints:
POST /sources/upload— File upload with content type detectionPOST /sources/{id}/analyze— Trigger knowledge ledger ingestion. Returns a run ID for SSE streaming.POST /sources/{id}/analyze/stream— Stream insights extraction via SSE
Knowledge (/knowledge)
Direct access to the knowledge ledger:
GET /knowledge/summary— Working summary of project knowledgeGET /knowledge/atoms— List/filter atoms (by kind, domain, tags, entity)GET /knowledge/contradictions— Open contradictionsPOST /knowledge/retrieve— Ranked retrieval (entity-linked -> metadata-filtered -> FTS fallback)GET /knowledge/runs/{run_id}/stream— SSE stream for ingestion run eventsPOST /knowledge/atoms/{id}/verify— Human verification of an atom (HITL)POST /knowledge/contradictions/{id}/resolve— Resolve a contradiction with rationalePOST /knowledge/merge-ops/{id}/approve— Approve/reject a merge operationPOST /knowledge/contradictions/rebuild-hard-replace— Hard-replace contradiction history and rebuild from active atoms
Insights (/insights)
User-facing projection of knowledge atoms. List, filter, create, update. (Citations are returned inline by the synthesize endpoint; there is no dedicated citations route, and insights are dismissed/resurrected rather than hard-deleted.)
Key endpoints:
POST /insights/synthesize— Cross-source pattern synthesis (returns a narrative synthesis string plus a list of cited atom IDs —{"synthesis": ..., "citations": [...]}— not insight objects)POST /insights/{id}/verify— Apply HITL verification to the insight's linked atomsPOST /insights/merge— Merge duplicate insightsPOST /insights/{id}/resurrect— Resurrect a dismissed insight and reactivate linked atoms
Features (/features)
Feature CRUD plus AI generation:
POST /features/generate/stream— Iterative feature generation with SSE streamingPOST /features/{id}/breakdown— Break down a feature into tasksGET /features/quality/stream— Project-wide feature quality assessment with SSE streaming
Tasks (/tasks)
Task CRUD, search, status updates, sprint assignment.
Key endpoints:
POST /tasks/{id}/assign— Assign a task to a team memberPOST /tasks/rebalance/assess— Assess whether a workload rebalance is neededPOST /tasks/rebalance— Rebalance workload across the team (preview)POST /tasks/rebalance/{proposal_id}/approve— Approve or reject a rebalance proposalPOST /tasks/rebalance/apply— Apply a rebalance plan
Sprints (/sprints)
Sprint lifecycle: create, plan, commit scope, start, complete.
POST /sprints/{id}/plan— Auto-plan sprint with SSE streamingPOST /sprints/{id}/commit— Commit sprint scope and activateGET /sprints/current— Get the active sprint
Team (/team)
Team member management. Add, update, remove members. Skills, capacity, workload queries.
Team Ledger (/team-ledger)
Internal team intelligence:
POST /team-ledger/analyze-changes— Ingest objective task/PR signals and refresh daily member metricsGET /team-ledger/metrics/daily— Daily objective member metricsPOST /team-ledger/testimony/analyze-changes— Ingest restricted testimony signalsGET /team-ledger/testimony/themes— Extracted testimony themesGET /team-ledger/contradictions— Team-dynamics contradictionsGET /team-ledger/escalations— List escalation cases (admin-only)GET /team-ledger/policy/fairness/active— Active fairness policy versionGET /team-ledger/policy/fairness/versions— Fairness policy version historyGET /team-ledger/rebalance/decisions/{decision_id}— Rebalance decision detailGET /team-ledger/rebalance/{proposal_id}/candidates— Candidate rebalance plans
Agents (/agents)
AI agent provisioning, management, and monitoring:
POST /agents— Provision a new AI agentPATCH /agents/{id}— Update agent configurationPOST /agents/{id}/pause,/resume,/terminate— Lifecycle controlPOST /agents/{id}/vm/spawn,/start,/stop,/restart— VM managementDELETE /agents/{id}/vm— Delete agent VMGET /agents/{id}/vm/status— VM statusGET /agents/{id}/status— Live agent statusGET /agents/{id}/stats— Agent statisticsGET /agents/{id}/logs— Execution logsGET /agents/{id}/messages— List messagesPOST /agents/{id}/messages— Send message to agentGET /agents/{id}/clarifications— Pending clarification requestsPOST /agents/{id}/clarifications/{cid}/answer— Answer a clarification
Agent Channel (/agent-channel)
Message queue between Aira and AI agent containers:
GET /agent-channel/{id}/messages— Poll pending messagesPOST /agent-channel/{id}/reply— Agent sends a replyPOST /agent-channel/{id}/task/{tid}/accept— Report task acceptancePOST /agent-channel/{id}/task/{tid}/status— Report task statusPOST /agent-channel/{id}/task/{tid}/pr— Report PR creationPOST /agent-channel/{id}/task/{tid}/clarification— Submit clarification requestPOST /agent-channel/{id}/heartbeat— Agent heartbeatPOST /agent-channel/{id}/log— Log execution action
Chat (/chat)
Conversational interface. Messages go through the full LangGraph pipeline.
Chat Sessions (/chat/sessions)
Session management for chat conversations. Create, list, update, archive.
Onboarding (/onboarding)
Multi-stage onboarding pipeline:
POST /onboarding/pipelines/start— Start or resume onboarding pipeline with idempotency keyGET /onboarding/pipelines/active— Get active pipeline for the current projectGET /onboarding/pipelines/{id}— Get a specific pipelineGET /onboarding/pipelines/{id}/stream— Stream pipeline events (SSE)POST /onboarding/pipelines/{id}/stream/session— Mint a short-lived stream-session token for direct SSE accessPOST /onboarding/pipelines/{id}/actions— Control pipeline (pause/resume/cancel/retry stage)POST /onboarding/pipelines/{id}/prd-edits— Submit PRD owner edit and trigger regenerationPOST /onboarding/pipelines/{id}/team-members— Add team member via onboarding flow
Reports (/reports)
AI-generated management reports:
POST /reports/sprint— Sprint reportPOST /reports/standup— Daily standupPOST /reports/retro— RetrospectivePOST /reports/forecast— Delivery forecastPOST /reports/risks— Risk assessmentPOST /reports/generate-pdf— PDF management report (streaming)
Stakeholder (/stakeholder)
Executive-facing intelligence:
POST /stakeholder/ask— Ask a stakeholder question (natural language)GET /stakeholder/dashboard— Stakeholder dashboardGET /stakeholder/questions— Question historyGET /stakeholder/schedules— List scheduled reportsPOST /stakeholder/reports— Save a report to historyPOST /stakeholder/schedule— Schedule a recurring report
PRD (/projects/{id}/prd)
Product Requirements Document (PRD routes are nested under the project):
POST /projects/{id}/prd/generate/stream— Generate/regenerate PRD with SSE streamingGET /projects/{id}/prd— Get current PRDGET /projects/{id}/prd/quality/stream— Quality assessment with SSE streamingPOST /projects/{id}/prd/quality/cancel— Cancel a running quality assessment
Roadmap (/roadmap)
Roadmap view data, timeline management, and what-if scenarios.
Quality (/quality)
Quality assessment results. List assessments, get specific assessment details.
Costs (/costs)
LLM usage tracking:
GET /costs— Usage summaryGET /costs/daily— Daily cost breakdownGET /costs/budget— Budget statusPUT /costs/budget— Update budget limitsGET /costs/optimize— Optimization suggestions
Dashboard (/dashboard)
Summary statistics: counts, sprint progress, team load.
Pulse (/pulse)
Attention items from static rules, AI review, and heartbeat checks:
GET /pulse/actions— Get current pulse actionsPOST /pulse/actions/generate— Force-generate fresh AI pulse actionsPOST /pulse/actions/{id}/dismiss— Dismiss a pulse action
Heartbeat (/heartbeat)
Custom monitoring items. Add, list, deactivate heartbeat items.
Activity (/activity)
Project activity log:
GET /activity— List activity entriesPOST /activity/stream/token— Request SSE stream tokenGET /activity/stream— Live activity stream (SSE)GET /activity/stats— Activity statisticsGET /activity/search— Search activity entries
Events (/events)
Append-only audit event log:
GET /events— List eventsGET /events/timeline— Event timelineGET /events/entity/{type}/{id}— Entity historyPOST /events/{id}/revert— Revert an event
Notifications (/notifications)
User notification management:
GET /notifications— List notificationsGET /notifications/unread/count— Unread countPUT /notifications/{id}/read— Mark one as readPUT /notifications/read-all— Mark all as readGET /notifications/preferences— Notification preferencesPUT /notifications/preferences— Update preferencesPOST /notifications/test— Send test notification
Issues (/projects/{id}/issues)
Issue tracking: CRUD for project issues with status and priority management.
Pull Requests (/pull-requests)
PR automation and tracking:
GET /tasks/{id}/pull-requests— List linked PRs for a taskPOST /tasks/{id}/pull-requests— Link a PR to a taskPOST /integrations/github/sync-prs— Sync PRs from connected GitHub reposPOST /integrations/bitbucket/sync-prs— Sync PRs from connected Bitbucket repos
Integrations (/integrations)
GitHub, Jira, Slack, Bitbucket, Telegram connection management. Each provider has its own OAuth sub-routes.
GET /projects/{id}/integrations— List configured integrationsPOST /projects/{id}/integrations/{id}/test— Test integration credentials- Provider-specific: GitHub OAuth + repo analysis, Bitbucket OAuth + workspace, Jira OAuth, Slack OAuth + event webhook, Telegram webhook
Communication (/communication)
Slack Q&A relay:
POST /communication/ask— Ask a question to a team member via SlackGET /communication/pending— List pending questionsGET /communication/history— Q&A history- Team-Slack member mapping management
Invitations (/invitations)
Project invitation management. Create, list, accept invitations.
Billing (/billing)
Subscription management and usage tracking.
LLM (/llm)
Available model listing:
GET /llm/models— All supported modelsGET /llm/models/available— Models with configured API keys
MCP (/mcp)
Model Context Protocol:
POST /mcp/bootstrap/token— Issue one-time MCP bootstrap tokenGET /mcp/tools/catalog— MCP tool catalogPOST /mcp/bootstrap/exchange— Exchange bootstrap token for a project API key- OAuth endpoints:
/.well-known/oauth-authorization-server,/mcp/oauth/authorize,/mcp/oauth/token
Webhooks (/webhooks)
Inbound webhook receivers for GitHub, Jira, Slack, Bitbucket, and Telegram events.
Admin (/admin)
System administration with 7 sub-modules:
| Module | Prefix | What it covers |
|---|---|---|
| Admin | /admin | User approval/rejection |
| Config | /admin/config | System config get/set with schema |
| Errors | /admin/errors | Error logs and stats by service/severity |
| Ledger | /admin/ledger | Ingestion runs, HITL events, knowledge regression tests, policy promotion |
| Performance | /admin/performance | Overview, per-agent, per-model, daily timeline, per-project breakdowns |
| Prompts | /admin/prompts | Prompt management, versioning, revert |
| Traces | /admin/traces | Distributed trace inspection |
Miscellaneous
| Route | Purpose |
|---|---|
/api/v1/health | Health check ({"status": "ok"}) — the only health route |
/docs | Documentation file serving |
/demo | Demo data load/delete |
/preferences | Per-user per-project UI preferences |
/analysis | Pattern and trend analysis across sources |
SSE streaming pattern
Long-running operations use Server-Sent Events for real-time progress:
Consuming an SSE stream
const response = await fetch('/api/v1/features/generate/stream', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <token>',
'X-Project-Id': '<project_id>'
},
body: JSON.stringify({ insight_ids: ['...'] })
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
buffer += decoder.decode(value, { stream: true });
const blocks = buffer.split('\n\n');
buffer = blocks.pop();
for (const block of blocks) {
const eventMatch = block.match(/^event: (.+)$/m);
const dataMatch = block.match(/^data: (.+)$/m);
if (!eventMatch || !dataMatch) continue;
const eventType = eventMatch[1];
const data = JSON.parse(dataMatch[1]);
switch (eventType) {
case 'feature':
case 'insight':
case 'task':
// Item generated — render it
break;
case 'progress':
// Processing update
break;
case 'done':
// Generation complete
return;
case 'error':
// Something went wrong
return;
}
}
}
Event types
| Event | Payload | When |
|---|---|---|
started | { run_id } | Processing begins |
progress | { phase, chunks_processed, total } | Processing update |
feature / insight / task | { data, progress } | Item generated |
new_atom_ids | [id, id, ...] | Atoms extracted (IDs only — fetch details separately) |
conflict_detected | { contradiction_id } | Contradiction found |
summary_updated | { summary } | Working summary refreshed |
done | { total_generated } | Processing complete |
error | { message } | Error occurred |
Backpressure
new_atom_idsandderived_artifact_idsare coalesced in 250ms windows- Target: 10 events/second max per stream under heavy load
- Events include a monotonic
seqfor ordering and dedup
SSE endpoints
The following operations support SSE streaming:
| Endpoint | What streams |
|---|---|
POST /features/generate/stream | Iterative feature generation |
GET /features/quality/stream | Feature quality assessment |
POST /projects/{id}/prd/generate/stream | PRD generation |
GET /projects/{id}/prd/quality/stream | PRD quality assessment |
POST /sprints/auto-plan/stream | Sprint auto-planning |
POST /sources/{id}/analyze/stream | Source analysis progress |
GET /knowledge/runs/{id}/stream | Ingestion run events |
GET /onboarding/pipelines/{id}/stream | Onboarding pipeline progress |
GET /activity/stream | Live activity feed |
OpenAPI docs
The app uses FastAPI's default documentation surface (no custom docs_url/redoc_url overrides), served at the server root:
- Swagger UI:
/docs(e.g.http://localhost:8000/docs) - ReDoc:
/redoc - OpenAPI JSON:
/openapi.json
The /api/v1/docs endpoint is a separate authenticated internal docs-file route, not the FastAPI Swagger UI.