Skip to main content
Missions orchestrate multi-agent task execution: a LEAD agent plans a breakdown, agents work tasks, and the mission moves through a status flow from PLANNING to a terminal state. Beyond CRUD, the API exposes lifecycle actions — start, restart, resume, and clone — plus task management, mission checkpoints, and workspace-wide metrics.
All mission endpoints require authentication and workspace context.

Endpoints


Missions

Create, read, update, and delete missions. Write operations require OWNER, ADMIN, or MANAGER role.

List All Missions (Workspace)

List all missions across the workspace. Query Parameters: The body stays a bare array. The total the filter matched — before limit/offset — is in the X-Total-Count response header, with X-Limit and X-Offset echoing the values applied. Response: 200 OK
The tasks array is only included when include_tasks=true; it is omitted from the default list response.

List Crew Missions

Query Parameters: Response: 200 OK — array of mission objects with task_stats. The same X-Total-Count, X-Limit and X-Offset headers as the workspace list, so a crew-scoped page knows how many rows the crew has.

Create Mission

Auth: OWNER, ADMIN, or MANAGER role Request Body:
The lead agent must exist in the specified crew and have the LEAD role. Response: 201 Created — mission object with status PLANNING. WebSocket events: mission.created on crew:{crewId}, mission.updated on workspace:{workspaceId}

Get Mission

Returns the mission with all tasks and task stats. Response: 200 OK

Update Mission

Auth: OWNER, ADMIN, or MANAGER role Request Body: All fields optional. Status Transitions: When status changes to DONE, FAILED, or CANCELLED, completed_at is automatically set.
Before this release, a mission approved out of REVIEW moved to COMPLETED while an issue approved the same way moved to DONE — two words for the identical operator action, sharing one column (missions.status). COMPLETED is now retired: this endpoint writes DONE for both. For backward compatibility, {"status":"COMPLETED"} is still accepted and silently normalized to DONE — it is never written or returned again. Any script or dashboard still matching the literal string COMPLETED on a mission’s status field should switch to DONE.
Response: 200 OK — updated mission object.

Delete Mission

Only missions in PLANNING or CANCELLED status can be deleted (hard delete).
Request: crewId and missionId are required path parameters; workspace_id selects the workspace. No request body. Auth: OWNER, ADMIN, or MANAGER role Response: 204 No Content

Lifecycle Actions

Drive a mission through execution: start a planned mission, or restart, resume, and clone existing ones. All require OWNER, ADMIN, or MANAGER role.

Start Mission

Transitions a PLANNING mission to IN_PROGRESS and starts the MissionEngine. Validates the task dependency DAG before starting. Uses atomic compare-and-swap to prevent concurrent start races. Auth: OWNER, ADMIN, or MANAGER role Response: 200 OK

Restart Mission

Restarts a DONE, FAILED, or CANCELLED mission. Resets non-COMPLETED tasks (PENDING if dependencies allow, BLOCKED otherwise), increments their iteration, clears errors, and moves the mission back to PLANNING (call start afterwards to dispatch). (internal/api/task_state.go:14) Request: crewId and missionId are required path parameters; workspace_id selects the workspace. No request body. Auth: OWNER, ADMIN, or MANAGER role Response: 200 OK

Resume Mission

Resumes a FAILED mission from the point of failure. The handler atomically claims the mission into RESUMING, resets the FAILED/AWAITING_APPROVAL tasks plus their downstream dependents, validates the DAG, and re-engages the MissionEngine. COMPLETED tasks are preserved. (internal/api/task_state.go:103) Request: crewId and missionId are required path parameters; workspace_id selects the workspace. No request body. Auth: OWNER, ADMIN, or MANAGER role Response: 200 OK

Clone Mission

Creates a copy of the mission with all its tasks, resetting statuses to PLANNING/PENDING (or BLOCKED if the cloned task carries dependencies). Request: crewId and missionId are required path parameters; workspace_id selects the workspace. No request body. Auth: OWNER, ADMIN, or MANAGER role Response: 201 Created
The handler returns the new mission id and status only; fetch GET /api/v1/crews/{crewId}/missions/{newId} for the full mission object (internal/api/task_state.go:472).

Tasks

Add and update the individual tasks that make up a mission’s work breakdown.

Create Task

Add a task to a mission. Auth: OWNER, ADMIN, or MANAGER role Request Body: (internal/api/task_handler.go:42) Tasks can only be added to missions in PLANNING or IN_PROGRESS state. If any dependency task is not COMPLETED, the new task is created with status BLOCKED; otherwise PENDING. Response: 201 Created

Update Task

Auth: Authenticated workspace caller with the mission write permission (OWNER, ADMIN, or MANAGER). Request: crewId, missionId, and taskId path parameters, optional workspace_id, and a JSON body containing any of the optional fields below. Response: the updated task object. Statuses: 200 OK; 400 for an invalid transition or body, 403 for insufficient role, 404 when the mission or task is not in the workspace, and 500 for a persistence failure. Request Body: All fields optional. (internal/api/task_handler.go:160 — updateTaskRequest) status and depends_on cannot be set in the same request — the handler returns 400 with “Cannot update status and depends_on in the same request” (internal/api/task_handler.go:382). task_order and approval_required are not currently mutable through this endpoint. Task Status Transitions: Response: 200 OK

Checkpoints

Cartographer checkpoints bookmark a mission’s journal cursor and state snapshot for the timeline UI. Cartographer checkpoints capture a mission’s journal cursor plus a state snapshot (agent-memory hashes, pending tasks, open assignments, crew container id) so the timeline UI can offer “list bookmarks” and (advisory) “restore/fork from here” affordances. The full restore/fork/get/delete surface is documented on the Checkpoints page; the two endpoints below are mission-scoped and live here for convenience. (internal/api/cartographer_handler.go)

List Mission Checkpoints

Returns newest-first checkpoints for a mission. Cross-workspace IDs are folded into the same 404 shape as “mission not found” so existence isn’t leaked. Query Parameters: Response: 200 OK

Create Mission Checkpoint

Captures the mission’s current journal cursor + materialized state and writes a checkpoint row. Body is optional — an unlabelled checkpoint is a valid “bookmark right now” gesture. (internal/api/cartographer_handler.go:91) Request Body: (optional)
Response: 201 Created — full checkpoint object (same shape as the List array entries above). When the row was committed but the immediate re-read failed, the response degrades to { "id": "chk_..." } so the client can still navigate to it.

Metrics

Workspace-wide aggregates for dashboards.

Mission Metrics

Auth: Authenticated workspace request. Request: required workspace_id query parameter; no body. Response: JSON aggregate metrics object. Statuses: 200 OK; 400 for missing or invalid workspace context, 401 when unauthenticated, and 500 for an aggregation failure. Aggregated mission metrics for the workspace. total_missions and active_missions are lifetime counts; the *_24h fields cover the trailing 24 hours. total_tokens_24h and total_cost_24h are mission totals: they sum the tokens and estimated cost of mission tasks completed in the window, and nothing else. Spend that happens outside a mission — chats, ad-hoc agent runs, routine runs — is not counted here, so a workspace can report 0 on both while it is genuinely spending money. That spend lives in the cost ledger, which the paymaster endpoints report (and crewship cost prints). A 0 here means “no mission task was recorded in the window”, not “no spend”. Response: 200 OK

Reference

Mission Statuses

Task Statuses