Documentation

API

A local REST and WebSocket API, the same one the desktop app uses.

Authentication

When an API token is configured it is written to ~/.foreman/token, and every request except /health must present it as a bearer token.

Terminal
curl -H "Authorization: Bearer <token>" \
  http://127.0.0.1:4319/projects

Without it you get a bare {"error":"unauthorized"}. Browsers can’t set headers on WebSocket or EventSource connections, so ?token= is accepted there instead.

Create and start a task

Terminal
curl -X POST http://127.0.0.1:4319/tasks \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "demo-repo",
    "title": "Update dependencies and run tests",
    "autonomyLevel": 1
  }'

Endpoints

A selection of the orchestrator’s REST surface. All of it listens on loopback unless you change FOREMAN_HOST.

MethodPathWhat it does
GET/healthLiveness check. The only endpoint that needs no token.
GET/projectsList registered projects.
POST/projectsRegister a repository as a project.
GET/tasksList tasks with their status, worker and autonomy level.
POST/tasksCreate a task.
POST/tasks/:id/startStart a task in a fresh worktree.
GET/tasks/:id/delivery-planHow the task’s changes will be delivered, and why.
POST/tasks/:id/pull-requestOpen the task’s branch as a draft pull request.
GET/sessions/:id/outputA worker session’s output so far.
POST/sessions/:id/stopStop a worker session safely.
GET/approvalsPending and resolved approval requests.
POST/approvals/:id/resolveApprove or deny a request.
GET/artifactsFiles captured into the Library.
GET/activityThe activity timeline.
POST/voice/interpretTurn a transcript into a command, with its risk.
GET/wsWebSocket: live output and events.