Skip to content

API Reference

Fleet exposes a REST API at http://localhost:3000/api. All request and response bodies use JSON unless otherwise noted.

Sessions

List Sessions

GET /api/sessions

Returns all sessions with live status merged from running instances.

Response (200):

json
[
  {
    "instanceId": "uuid",
    "workspaceId": "uuid",
    "workspaceDirectory": "/home/dev/my-project",
    "workspaceDisplayName": "My Project",
    "isolationStrategy": "worktree",
    "sessionStatus": "idle",
    "instanceStatus": "running",
    "dbId": "uuid",
    "session": {
      "id": "opencode-session-id",
      "title": "Implement auth module"
    }
  }
]

Create Session

POST /api/sessions

Request body:

FieldTypeRequiredDescription
directorystringYesAbsolute path to the workspace directory
titlestringNoSession title (default: "New Session")
isolationStrategy"existing" | "worktree" | "clone"NoWorkspace isolation (default: "existing")
branchstringNoGit branch for worktree/clone
onCompleteobjectNoCallback config: { notifySessionId, notifyInstanceId }

Response (200):

json
{
  "instanceId": "uuid",
  "workspaceId": "uuid",
  "session": {
    "id": "opencode-session-id",
    "title": "Implement auth module"
  }
}

Get Session Detail

GET /api/sessions/{id}?instanceId={instanceId}

Returns session data with messages and workspace metadata.

Response (200):

json
{
  "session": { "id": "...", "title": "..." },
  "messages": [],
  "workspaceId": "uuid",
  "workspaceDirectory": "/home/dev/my-project",
  "isolationStrategy": "existing"
}

Rename Session

PATCH /api/sessions/{id}

Request body:

json
{ "title": "New Title" }

Response (200):

json
{ "id": "uuid", "title": "New Title" }

Errors: 400 if title is missing or empty, 404 if session not found.

Terminate Session

DELETE /api/sessions/{id}?instanceId={instanceId}

Optional query parameters:

ParameterDescription
cleanupWorkspaceSet to true to delete the worktree/clone directory
permanentSet to true to permanently remove from database

Response (200):

json
{ "message": "Session terminated" }

Send Prompt

POST /api/sessions/{id}/prompt

Request body:

json
{
  "instanceId": "uuid",
  "text": "Your prompt here",
  "agent": "shuttle"
}

The agent field is optional. Returns 204 No Content.

Abort Session

POST /api/sessions/{id}/abort?instanceId={instanceId}

Response (200):

json
{ "message": "Session aborted" }

Resume Session

POST /api/sessions/{id}/resume

Response (200):

json
{
  "instanceId": "uuid",
  "session": { "id": "...", "title": "..." }
}

Session Events (SSE)

GET /api/sessions/{id}/events?instanceId={instanceId}

Server-Sent Events stream. Each event is JSON:

data: {"type": "session.status", "properties": {...}}

Event types include session.status, session.idle, part.*, message.*, error, and permission.*. The connection sends keepalive comments every 15 seconds.

Session Messages (Paginated)

GET /api/sessions/{id}/messages?instanceId={instanceId}&limit=50&before={messageId}

ParameterDefaultDescription
limit50Max messages to return (max 200)
beforeCursor for pagination (message ID)

Session Diffs

GET /api/sessions/{id}/diffs?instanceId={instanceId}

Response (200):

json
[
  {
    "file": "src/auth.ts",
    "before": "...",
    "after": "...",
    "additions": 15,
    "deletions": 3,
    "status": "modified"
  }
]

Session History

GET /api/sessions/history

ParameterDefaultDescription
searchFull-text search on title
statusFilter by status
fromStart date (ISO 8601)
toEnd date (ISO 8601)
limit20Max results (max 100)
offset0Pagination offset

Response (200):

json
{
  "sessions": [
    { "id": "...", "title": "...", "status": "completed" }
  ],
  "total": 42
}

Workspaces

Rename Workspace

PATCH /api/workspaces/{id}

Request body:

json
{ "displayName": "My Project" }

Response (200):

json
{ "id": "uuid", "displayName": "My Project" }

Workspace Roots

List Workspace Roots

GET /api/workspace-roots

Response (200):

json
{
  "roots": [
    { "id": null, "path": "/home/user", "source": "env", "exists": true },
    { "id": "uuid", "path": "/home/user/projects", "source": "user", "exists": true }
  ]
}

Add Workspace Root

POST /api/workspace-roots

Request body:

json
{ "path": "/absolute/path" }

Response (201):

json
{ "id": "uuid", "path": "/resolved/path" }

Remove Workspace Root

DELETE /api/workspace-roots/{id}

Only user-added roots (source: "user") can be removed. Environment roots cannot be deleted.

Response (200):

json
{ "ok": true }

Directories

Browse Directories

GET /api/directories?path={absolutePath}&search={term}

Lists subdirectories within an allowed workspace root. Omit path to list the roots themselves.

Response (200):

json
{
  "entries": [
    { "name": "my-project", "path": "/home/user/my-project", "isGitRepo": true }
  ],
  "currentPath": "/home/user",
  "parentPath": null,
  "roots": ["/home/user"]
}

Noise directories (.git, node_modules, .next, etc.) and hidden directories are excluded.


Instances

List Commands

GET /api/instances/{id}/commands

Response (200):

json
[
  { "name": "compact", "description": "Compact the conversation" }
]

List Agents

GET /api/instances/{id}/agents

Response (200):

json
[
  { "name": "shuttle", "description": "...", "mode": "code", "color": "#..." }
]

Find Files

GET /api/instances/{id}/find/files?query={searchTerm}

Fuzzy-search files in the instance's workspace. Returns up to 20 results. Query max 256 characters.

Response (200): string[] (file paths)


Notifications

List Notifications

GET /api/notifications?unread=true&limit=50

Response (200): Array of notification objects.

Mark Notification Read

PATCH /api/notifications/{id}

Use id=all to mark all notifications as read.

Response (200):

json
{ "success": true }

Delete All Notifications

DELETE /api/notifications

Response (200):

json
{ "deleted": 5 }

Unread Count

GET /api/notifications/unread-count

Response (200):

json
{ "count": 3 }

Notification Stream (SSE)

GET /api/notifications/stream

Real-time notification delivery via Server-Sent Events:

data: {"type": "notification", "notification": {...}}

Fleet

Fleet Summary

GET /api/fleet/summary

Response (200):

json
{
  "activeSessions": 2,
  "idleSessions": 1,
  "totalTokens": 0,
  "totalCost": 0,
  "queuedTasks": 0
}

Config

Get Config

GET /api/config

Returns user-level Weave config, installed skills, and config file paths.

Update Config

PUT /api/config

Request body: Full or partial config object (must include agents key).

Response (200):

json
{ "ok": true }

Skills

List Skills

GET /api/skills

Response (200):

json
{ "skills": [] }

Install Skill

POST /api/skills

Request body:

json
{ "url": "https://...", "agents": ["shuttle"] }

Or install from content directly:

json
{ "content": "# Skill content...", "agents": ["shuttle"] }

Response (201):

json
{ "ok": true, "skill": {} }

Remove Skill

DELETE /api/skills/{name}

Response (200):

json
{ "ok": true }

Version

Get Version

GET /api/version

Response (200):

json
{
  "version": "0.5.0",
  "latest": "0.5.0",
  "updateAvailable": false,
  "checkedAt": "2026-03-05T10:30:00.000Z"
}

Open Directory

Open in Editor / Terminal

POST /api/open-directory

Request body:

json
{
  "directory": "/absolute/path",
  "tool": "vscode"
}

Allowed tools: vscode, cursor, terminal, explorer.

Response (200):

json
{ "ok": true }

Released under the MIT License.