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/projectsWithout 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.
| Method | Path | What it does |
|---|---|---|
| GET | /health | Liveness check. The only endpoint that needs no token. |
| GET | /projects | List registered projects. |
| POST | /projects | Register a repository as a project. |
| GET | /tasks | List tasks with their status, worker and autonomy level. |
| POST | /tasks | Create a task. |
| POST | /tasks/:id/start | Start a task in a fresh worktree. |
| GET | /tasks/:id/delivery-plan | How the task’s changes will be delivered, and why. |
| POST | /tasks/:id/pull-request | Open the task’s branch as a draft pull request. |
| GET | /sessions/:id/output | A worker session’s output so far. |
| POST | /sessions/:id/stop | Stop a worker session safely. |
| GET | /approvals | Pending and resolved approval requests. |
| POST | /approvals/:id/resolve | Approve or deny a request. |
| GET | /artifacts | Files captured into the Library. |
| GET | /activity | The activity timeline. |
| POST | /voice/interpret | Turn a transcript into a command, with its risk. |
| GET | /ws | WebSocket: live output and events. |