REST API

The web server exposes a JSON API under /api/. You can call these endpoints through the running server or directly from the CLI with dodo api.

CLI Access

The dodo api command calls endpoints without needing a running server:

dodo api tasks                                    # GET /api/tasks
dodo api get tasks                                # explicit method
dodo api post tasks -d '{"title": "My task"}'     # create
dodo api patch tasks/abc123 -d '{"status": "done"}'
dodo api delete tasks/abc123

Endpoints

List Tasks

GET /api/tasks

Query parameters:

ParameterTypeDescription
statusstringFilter by status (open, in-progress, blocked, done)
tagstringFilter by tag
parentstringFilter by parent task ID

Returns Array<Task>.

Create Task

POST /api/tasks

Body (application/json):

FieldTypeRequiredDescription
titlestringyesTask title
descriptionstringTask description
parent_idstring or nullParent task ID
tagsArray<string>Tags to assign
blocked_byArray<string>IDs of blocking tasks

Returns Task with status 201.

Search Tasks

GET /api/tasks/search

Query parameters:

ParameterTypeRequiredDescription
qstringyesSearch query
statusstringFilter by status
tagstringFilter by tag
allbooleanInclude done tasks (default: false)
limitnumberMax results (default: 20)

Returns Array<Task & { _score: number }> sorted by relevance.

Get Task

GET /api/tasks/:id

Returns Task or 404.

Update Task

PATCH /api/tasks/:id

Body (application/json):

FieldTypeDescription
titlestringNew title
descriptionstringNew description
statusTaskStatusNew status
parent_idstring or nullNew parent ID (null to unset)
add_tagsArray<string>Tags to add
remove_tagsArray<string>Tags to remove
add_blockersArray<string>Blocker IDs to add
remove_blockersArray<string>Blocker IDs to remove

All fields are optional. Returns the updated Task.

Delete Task

DELETE /api/tasks/:id

Deletes the task and cleans up all references. Returns { "deleted": true }.

Get Prompt Template

GET /api/prompt-template

Returns the current prompt template and available variables:

{
  "template": "I need you to work on the following task...",
  "variables": ["{{id}} - Task ID", "{{title}} - Task title", "..."]
}

Save Prompt Template

PUT /api/prompt-template

Body (application/json):

FieldTypeRequiredDescription
templatestringyesTemplate text with {{variable}} placeholders

Saves the template to .dodo/prompt-template.txt. Returns { "ok": true }.

Introspect

GET /api/__introspect

Returns a machine-readable description of all API endpoints, including methods, parameters, body schemas, and response types.

Task Schema

interface Task {
  id: string;
  title: string;
  description: string;
  status: "open" | "in-progress" | "blocked" | "done";
  parent_id: string | null;
  children: Array<string>;
  blocked_by: Array<string>;
  blocks: Array<string>;
  tags: Array<string>;
  created_at: string;
  updated_at: string;
}