Skip to content

REST API Reference

All API routes are defined as Nitro file-based routes under server/api/. The base URL is http://localhost:3000/api.

Projects

List Projects

GET /api/projects

Returns all detected projects.

Create Project

POST /api/projects
FieldTypeRequiredDescription
namestringyesProject name
pathstringyesAbsolute path to project root
typestringyesbackend, frontend, fullstack, or module
identifierPrefixstringyesUnique prefix for issue identifiers (e.g., SYM)

Get Project by Slug

GET /api/projects/by-slug/:slug

Get Project by ID

GET /api/projects/:projectId

Update Project

PUT /api/projects/:projectId

Accepts partial project fields to update. Includes config for project settings.

Rescan Projects

POST /api/projects/rescan

Re-runs project auto-detection to discover new projects in the workspace.

Setup Wizard

POST /api/projects/:projectId/setup-wizard

Triggers the setup wizard agent for a project.

Pipeline

GET /api/projects/:projectId/pipeline

Returns the phase pipeline state for all issues in the project.

Cost Summary

GET /api/projects/:projectId/cost-summary

Returns aggregated agent run cost data for the project.

Cost Timeline

GET /api/projects/:projectId/cost-timeline

Returns cost data over time for the project.

Research Coverage

GET /api/projects/:projectId/research/coverage

Returns research coverage metrics for the project.

Agent Prompts

GET /api/projects/:projectId/agent-prompts

Returns the resolved agent prompts (system + user) for preview.

Experiments

GET /api/projects/:projectId/experiments

Returns experiment configuration and results for the project.

Issues

List Issues

GET /api/projects/:projectId/issues
Query ParamTypeDescription
statusstringFilter by status
labelstringFilter by label
limitnumberMax results (default 50, max 100)

Create Issue

POST /api/projects/:projectId/issues
FieldTypeRequiredDescription
titlestringyesIssue title
descriptionstringnoIssue description (markdown)
prioritynumberno1=urgent, 2=high, 3=medium (default), 4=low
sizestringnosmall, medium, or large
labelsstring[]noLabels array
statusstringnoInitial status (default: backlog)

Get Issue by ID

GET /api/projects/:projectId/issues/:issueId

Get Issue by Identifier

GET /api/projects/:projectId/issues/by-identifier/:identifier

Update Issue

PUT /api/projects/:projectId/issues/:issueId

Accepts partial issue fields. Status changes are validated against the transition map.

Delete Issue

DELETE /api/projects/:projectId/issues/:issueId

Update Issue Status

PUT /api/projects/:projectId/issues/:issueId/status
FieldTypeRequiredDescription
statusstringyesNew status (must be a valid transition)
reasonstringnoReason for the status change

Issue Sub-Resources

Comments

GET  /api/projects/:projectId/issues/:issueId/comments
POST /api/projects/:projectId/issues/:issueId/comments
FieldTypeRequiredDescription
contentstringyesComment text
authorstringnouser, agent, or system (default: user)

Findings

GET  /api/projects/:projectId/issues/:issueId/findings
POST /api/projects/:projectId/issues/:issueId/findings
FieldTypeRequiredDescription
categorystringyestest_result, code_pattern, architecture, bug, or gap
summarystringyesShort summary
detailsstringnoFull details
filesstring[]noRelated file paths

Learnings

GET  /api/projects/:projectId/issues/:issueId/learnings
POST /api/projects/:projectId/issues/:issueId/learnings
FieldTypeRequiredDescription
patternstringyesPattern description
contextstringnoWhen/where this applies
applies_tostring[]noDirectory/file prefixes

Dependencies

POST   /api/projects/:projectId/issues/:issueId/dependencies
DELETE /api/projects/:projectId/issues/:issueId/dependencies
FieldTypeRequiredDescription
dependsOnIdstringyesID of the issue this depends on

Merge

POST /api/projects/:projectId/issues/:issueId/merge

Merges the issue's branch into the base branch. Used after PR approval.

Events

GET /api/projects/:projectId/issues/:issueId/events

Returns the event history for the issue (status changes, agent runs, comments).

Agent Runs

GET /api/projects/:projectId/issues/:issueId/runs/:runId

Returns details for a specific agent run, including log output, structured exitReason, and heuristic summary.

The exitReason field is a JSON object with:

  • reason — discriminated union on type field (e.g., completed, timeout, phase_completed, circuit_break, process_killed)
  • action — one of done, retry, circuit_break, noop

The summary field (nullable JSON string) is a heuristic post-run summary generated from agent_events:

  • tools — array of { name, count } sorted by count descending
  • files — deduplicated file paths extracted from tool inputs
  • totalToolCalls — total number of tool invocations
  • outcome — detected outcome (e.g., completed phase:research, created PR, approved PR)
  • oneLiner — human-readable single-line summary
  • source — always "heuristic" (future: "model" for LLM-generated summaries)

Pull Requests

Get PR

GET /api/projects/:projectId/issues/:issueId/pr

Returns the latest PR for the issue, including diff snapshot, file stats, gate results, and risk score.

Get PR Diff

GET /api/projects/:projectId/issues/:issueId/pr/diff

Returns just the diff content.

Reject PR

POST /api/projects/:projectId/issues/:issueId/pr/reject
FieldTypeRequiredDescription
reasonstringnoRejection reason
fix_instructionsstringnoInstructions for the worker

Agent Profiles

List Profiles

GET /api/projects/:projectId/agent-profiles

Create Profile

POST /api/projects/:projectId/agent-profiles
FieldTypeRequiredDescription
namestringyesProfile name
typestringyesplanner, worker, judge, researcher, or custom
systemPromptstringnoCustom instructions (appended to default)
modelstringnoModel override

Update Profile

PUT /api/projects/:projectId/agent-profiles/:profileId

Delete Profile

DELETE /api/projects/:projectId/agent-profiles/:profileId

Labels

List Labels

GET /api/projects/:projectId/labels

Create Label

POST /api/projects/:projectId/labels

Update Label

PUT /api/projects/:projectId/labels/:labelId

Delete Label

DELETE /api/projects/:projectId/labels/:labelId

Seed Default Labels

POST /api/projects/:projectId/labels/seed

Seeds the project with the default label set.

Intake

Submit Intake Batch

POST /api/projects/:projectId/intake

Submits a batch of issues for AI-assisted intake processing (parsing, deduplication, prioritization).

Get Intake Batch

GET /api/projects/:projectId/intake/:batchId

Returns the status and results of an intake batch.

Learnings (Project-Level)

List Project Learnings

GET /api/projects/:projectId/learnings

Returns all learnings across all issues in the project.

Update Learning

PUT /api/projects/:projectId/learnings/:learningId

Delete Learning

DELETE /api/projects/:projectId/learnings/:learningId

Search Learnings

GET /api/projects/:projectId/learnings/search?query=<text>

Searches learnings across all issues in the project by full-text match.

Workspace

Workspace Summary

GET /api/workspace/summary

Returns a high-level summary across all projects (issue counts, active agents, etc.).

Workspace Issues

GET /api/workspace/issues

Returns issues across all projects, with optional filtering.

Workspace Dependencies

GET /api/workspace/dependencies

Returns cross-project issue dependency graph.

Workspace Cost Summary

GET /api/workspace/cost-summary

Returns aggregated cost data across all projects.

Workspace Analytics

GET /api/workspace/analytics

Returns throughput, cycle time, and other analytics across all projects.

Search Issues

GET /api/issues/search?query=<text>

Full-text search across issues in all projects.

Notifications

List Notifications

GET /api/notifications

Returns unread notifications for the current session.

Mark Notification Read

PUT /api/notifications/:id/read

Mark All Read

PUT /api/notifications/read-all

Delete Read Notifications

DELETE /api/notifications/read

Orchestrator

Get Status

GET /api/orchestrator/status

Returns running agents, retry queue, and concurrency info.

Liveness Probe (Health)

GET /api/orchestrator/health

Public endpoint (no authentication required). Returns orchestrator health classification with appropriate HTTP status codes for monitoring and Kubernetes liveness probes.

HTTP Status Codes:

  • 200 — healthy or degraded (orchestrator is alive)
  • 503 — unhealthy (tick loop stalled or DB unreachable)

Status Classification (based on tick loop staleness relative to poll_interval_ms):

  • healthy: last tick < 2x poll_interval (default: < 10s)
  • degraded: last tick < 5x poll_interval (default: < 25s)
  • unhealthy: last tick >= 5x poll_interval or DB unreachable

Response fields:

FieldTypeDescription
availablebooleanWhether metrics are available (backward compatible)
stalebooleanWhether orchestrator is not healthy (backward compatible)
statusstringhealthy, degraded, or unhealthy
reasonstringHuman-readable explanation
staleSinceSecondsnumberSeconds since last metrics update
metricsobject/nullFull health metrics snapshot

Example (healthy, 200):

json
{
  "available": true,
  "stale": false,
  "status": "healthy",
  "reason": "Orchestrator operating normally",
  "staleSinceSeconds": 2,
  "metrics": { "generatedAt": "...", "uptimeSeconds": 300, "pid": 1234, "..." : "..." }
}

Example (unhealthy, 503):

json
{
  "available": true,
  "stale": true,
  "status": "unhealthy",
  "reason": "Orchestrator tick loop stalled for 30s (threshold: 25s)",
  "staleSinceSeconds": 30,
  "metrics": { "..." : "..." }
}

Readiness Probe

GET /api/orchestrator/ready

Public endpoint (no authentication required). Kubernetes-style readiness probe. Returns 200 only when the orchestrator is fully initialized and operating normally.

Readiness Checks:

  1. tickLoopHealthy — Tick loop is not stalled (status is not unhealthy)
  2. dbInitialized — Database file exists and has data (size > 0)
  3. contractsLoaded — All phase contracts loaded successfully

HTTP Status Codes:

  • 200 — ready (all checks pass)
  • 503 — not ready (one or more checks failed)

Response fields:

FieldTypeDescription
readybooleanWhether all readiness checks pass
statusstringHealth classification (healthy/degraded/unhealthy)
checksobjectIndividual check results
detailsobjectHuman-readable reasons per check

Example (ready, 200):

json
{
  "ready": true,
  "status": "healthy",
  "checks": { "tickLoopHealthy": true, "dbInitialized": true, "contractsLoaded": true },
  "details": { "tickLoopReason": "OK", "dbReason": "OK", "contractReason": "OK" }
}

Example (not ready, 503):

json
{
  "ready": false,
  "status": "unhealthy",
  "checks": { "tickLoopHealthy": false, "dbInitialized": true, "contractsLoaded": true },
  "details": { "tickLoopReason": "Orchestrator tick loop stalled for 30s (threshold: 25s)", "dbReason": "OK", "contractReason": "OK" }
}

Use Cases:

  • Kubernetes: Readiness probe waits for /ready to return 200 before routing traffic
  • CI/CD: Poll /ready before running integration tests
  • Monitoring: Distinguish between "starting up" (not ready) and "stuck" (unhealthy)

Refresh

POST /api/orchestrator/refresh

Triggers an immediate orchestrator tick.

Checkpoint

POST /api/orchestrator/checkpoint

Forces the orchestrator to checkpoint its current state.

Prompt Stats

GET /api/orchestrator/prompt-stats

Returns token usage statistics for recent agent prompts.

Stream Logs

GET /api/orchestrator/logs/stream

Server-Sent Events (SSE) stream of live agent log output. Connect with EventSource.

Status Transitions

Valid status transitions enforced by the API:

FromAllowed Destinations
backlogtodo
todobacklog, cancelled
in_progressreview, todo, blocked
blockedtodo
reviewdone, todo
donetodo
cancelledbacklog, todo

The orchestrator also performs: todo -> in_progress (dispatch) and in_progress -> todo (failure/retry).