The Optio API is a REST API served by Fastify. All endpoints are prefixed with /api and return JSON. Request bodies use JSON with Zod schema validation.
Info
All endpoints except /api/health, /api/auth/*, and /api/setup/* require authentication via the optio_session cookie or a ?token= query parameter.
Health
Method
Endpoint
Description
GET
/api/health
Health check endpoint (no auth required)
Tasks
Tasks are the core resource. Each task represents an agent run against a repository.
Method
Endpoint
Description
GET
/api/tasks
List tasks (filterable by state, repo, type)
POST
/api/tasks
Create a new task
GET
/api/tasks/:id
Get task details
PATCH
/api/tasks/:id
Update a task
DELETE
/api/tasks/:id
Delete a task
POST
/api/tasks/:id/cancel
Cancel a running or queued task
POST
/api/tasks/:id/retry
Retry a failed task
POST
/api/tasks/:id/resume
Resume a needs_attention or failed task with new context
POST
/api/tasks/:id/force-restart
Fresh agent session on existing PR branch
POST
/api/tasks/:id/force-redo
Clear everything and re-run from scratch
POST
/api/tasks/:id/review
Manually launch a code review agent
POST
/api/tasks/reorder
Reorder task priorities by position
Create Task Example
POST /api/tasks
{
"title": "Add user avatar support",
"prompt": "Add avatar upload and display to user profiles",
"repoUrl": "https://github.com/acme/webapp",
"repoBranch": "main",
"agentType": "claude",
"priority": 0
}
Bulk Operations
Method
Endpoint
Description
POST
/api/tasks/bulk/retry-failed
Retry all failed tasks
POST
/api/tasks/bulk/cancel-active
Cancel all running and queued tasks
Subtasks
Tasks can have child tasks. Three subtask types are supported: child (independent), step (sequential pipeline), and review (code review).
Method
Endpoint
Description
GET
/api/tasks/:id/subtasks
List subtasks of a task
POST
/api/tasks/:id/subtasks
Create a subtask (child, step, or review)
GET
/api/tasks/:id/subtasks/status
Get subtask completion status
Task Comments
Method
Endpoint
Description
GET
/api/tasks/:id/comments
List comments on a task
POST
/api/tasks/:id/comments
Add a comment to a task
Task Dependencies
Method
Endpoint
Description
GET
/api/tasks/:id/dependencies
List task dependencies
POST
/api/tasks/:id/dependencies
Add a dependency (task must complete before this task starts)
DELETE
/api/tasks/:id/dependencies/:depId
Remove a dependency
Repositories
Manage connected repositories and their per-repo settings.
Method
Endpoint
Description
GET
/api/repos
List connected repositories
POST
/api/repos
Connect a new repository
GET
/api/repos/:id
Get repository details and settings
PATCH
/api/repos/:id
Update repository settings
DELETE
/api/repos/:id
Disconnect a repository
Issues
Browse and assign GitHub Issues from connected repositories.