Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.crewship.ai/llms.txt

Use this file to discover all available pages before exploring further.

All agent endpoints require authentication and workspace context (workspace_id query parameter).

Crews Status

GET /api/v1/agents/crews-status?workspace_id={workspaceId}

# Response is a per-workspace aggregate counting agents by status
# (IDLE/RUNNING/ERROR — no STOPPED bucket). Drives the 'Crews idle/online'
# badge in the top toolbar.
Returns lightweight agent counts by status for toolbar/dashboard widgets. Response: 200 OK
{
  "total": 12,
  "running": 3,
  "error": 1,
  "idle": 8
}
The three status fields (running, error, idle) are always present in the response — zero counts are not omitted. There is no stopped bucket: agents that exit cleanly are surfaced as idle until their container is reaped.

Agent Load

GET /api/v1/agent-load?workspace_id={workspaceId}
Returns agent load metrics across the workspace.

List Agents

GET /api/v1/agents?workspace_id={workspaceId}
Query Parameters:
ParameterTypeDescription
workspace_idstringRequired. Workspace ID
crew_idstringOptional. Filter by crew
Response: 200 OK
[
  {
    "id": "agent_abc",
    "crew_id": "crew_123",
    "workspace_id": "ws_456",
    "name": "Backend Dev",
    "slug": "backend-dev",
    "description": "Go backend developer",
    "role_title": "Senior Developer",
    "agent_role": "AGENT",
    "lead_mode": null,
    "status": "IDLE",
    "cli_adapter": "CLAUDE_CODE",
    "llm_provider": "ANTHROPIC",
    "llm_model": "claude-sonnet-4-20250514",
    "system_prompt": "You are a Go backend developer...",
    "avatar_seed": "backend-dev",
    "avatar_style": "bottts",
    "timeout_seconds": 1800,
    "tool_profile": "CODING",
    "memory_enabled": true,
    "cli_tools": null,
    "schedule_cron": null,
    "schedule_prompt": null,
    "schedule_enabled": false,
    "schedule_last_run": null,
    "schedule_next_run": null,
    "mcp_config_json": null,
    "created_at": "2024-01-15T10:00:00Z",
    "updated_at": "2024-01-15T10:00:00Z",
    "crew": {
      "name": "Engineering",
      "slug": "engineering",
      "color": "blue",
      "avatar_style": "bottts"
    },
    "_count": {
      "skills": 2,
      "credentials": 1,
      "chats": 5
    }
  }
]

Response Fields

FieldTypeDescription
idstringAgent ID
crew_idstringParent crew ID
workspace_idstringWorkspace ID
namestringDisplay name
slugstringURL-safe identifier
descriptionstring?Agent description
role_titlestring?Human-readable role title
agent_rolestringAGENT or LEAD
lead_modestring?"active" or "passive" (LEAD agents only)
statusstringIDLE, RUNNING, or ERROR
cli_adapterstringCLI tool used to run the agent
llm_providerstring?LLM provider name
llm_modelstring?LLM model identifier
system_promptstring?System prompt for the agent
avatar_seedstring?Seed for avatar generation
avatar_stylestring?Avatar style (e.g., "bottts", "pixel-art")
timeout_secondsintegerMaximum execution time
tool_profilestringTool access profile
memory_enabledbooleanWhether agent memory is enabled
cli_toolsstring?Comma-separated list of allowed CLI tools
schedule_cronstring?Cron expression for scheduled runs
schedule_promptstring?Prompt used for scheduled runs
schedule_enabledbooleanWhether schedule is active
schedule_last_runstring?ISO 8601 timestamp of last scheduled run
schedule_next_runstring?ISO 8601 timestamp of next scheduled run
mcp_config_jsonstring?Agent-level MCP server config
crewobject?Embedded crew info (name, slug, color, avatar_style)
_countobjectCounts: skills, credentials, chats

Create Agent

POST /api/v1/agents?workspace_id={workspaceId}
Auth: OWNER, ADMIN, or MANAGER role Request Body:
FieldTypeRequiredDefaultDescription
namestringYesDisplay name (2-100 characters)
slugstringYesURL-safe identifier (2-50 chars, lowercase letters/digits/hyphens)
crew_idstringConditionalnullParent crew ID. Required when agent_role is LEAD; optional for AGENT (internal/api/agents_create.go:73)
descriptionstringNonullAgent description
role_titlestringNonullHuman-readable role title
agent_rolestringNo"AGENT"AGENT or LEAD
lead_modestringNo"active""active" or "passive" (LEAD agents only)
cli_adapterstringNo"CLAUDE_CODE"CLI adapter
llm_providerstringNonullLLM provider
llm_modelstringNonullLLM model
system_promptstringNonullSystem prompt
avatar_seedstringNonullAvatar seed
avatar_stylestringNonullAvatar style
timeout_secondsintegerNo1800Max execution time in seconds
tool_profilestringNo"CODING"Tool profile
memory_enabledbooleanNofalseEnable agent memory
{
  "name": "Backend Dev",
  "slug": "backend-dev",
  "crew_id": "crew_123",
  "agent_role": "AGENT",
  "cli_adapter": "CLAUDE_CODE",
  "system_prompt": "You are a Go backend developer...",
  "memory_enabled": true,
  "tool_profile": "CODING"
}
Agent Roles:
RoleDescriptionCrew Required
AGENTWorker that executes tasksYes
LEADCrew leader that plans and delegatesYes (max 1 per crew)
CLI Adapters: CLAUDE_CODE, CODEX_CLI, GEMINI_CLI, OPENCODE, CURSOR_CLI, FACTORY_DROID Tool Profiles: MINIMAL, CODING, FULL Response: 201 Created — returns the created agent object.
StatusCondition
400Invalid name, slug, role, or missing required crew_id
402License agent limit exceeded
403Insufficient role
409Slug already taken, or crew already has a LEAD agent

Get Agent

GET /api/v1/agents/{agentId}?workspace_id={workspaceId}
Response: 200 OK — full agent object.
StatusCondition
404Agent not found

Update Agent

PATCH /api/v1/agents/{agentId}?workspace_id={workspaceId}
Partial update — only provided fields are changed. Auth: OWNER, ADMIN, or MANAGER role (canRole(role, "create") in internal/api/agents_update.go:18) Request Body: Same fields as Create, all optional. status is not mutable through this endpoint. Additionally supports:
FieldTypeDescription
cli_toolsstringComma-separated CLI tools
schedule_cronstringCron expression
schedule_promptstringSchedule prompt
schedule_enabledbooleanEnable/disable schedule
mcp_config_jsonstringAgent MCP config JSON (must contain an mcpServers object)
Response: 200 OK — updated agent object.

Delete Agent

DELETE /api/v1/agents/{agentId}?workspace_id={workspaceId}
Soft-deletes the agent (sets deleted_at). Auth: OWNER or ADMIN role (canRole(role, "manage") in internal/api/agents_query.go:220) Response: 200 OK
{ "success": true }

Agent Skills

List Skills

GET /api/v1/agents/{agentId}/skills?workspace_id={workspaceId}
Response: 200 OK — array of skill assignment objects.

Add Skill

POST /api/v1/agents/{agentId}/skills?workspace_id={workspaceId}
{
  "skill_id": "skill_abc"
}
Response: 201 Created

Remove Skill

DELETE /api/v1/agents/{agentId}/skills/{skillId}?workspace_id={workspaceId}
Response: 204 No Content

Agent Credentials

List Credentials

GET /api/v1/agents/{agentId}/credentials?workspace_id={workspaceId}
Response: 200 OK — array of credential assignment objects.

Assign Credential

POST /api/v1/agents/{agentId}/credentials?workspace_id={workspaceId}
Auth: OWNER or ADMIN role (canRole(role, "manage") in internal/api/agent_credentials.go:89) Request Body:
FieldTypeRequiredDescription
credential_idstringYesCredential to assign (must exist in this workspace)
env_var_namestringYesEnvironment variable name to inject into the agent container
priorityintegerNoResolution priority when multiple credentials share an env_var_name
{
  "credential_id": "cred_abc",
  "env_var_name": "ANTHROPIC_API_KEY",
  "priority": 0
}
Response: 201 Created
{ "id": "<assignment_id>" }
StatusCondition
400Missing credential_id or env_var_name
403Insufficient role
404Agent or credential not found
409Credential already assigned to this agent

Remove Credential

DELETE /api/v1/agents/{agentId}/credentials/{assignmentId}?workspace_id={workspaceId}
The path segment is the assignment ID (agent_credentials.id), not the credential id. Auth: OWNER or ADMIN role (canRole(role, "manage") in internal/api/agent_credentials.go:146) Response: 200 OK
{ "success": true }

Agent Chats

List Chats

GET /api/v1/agents/{agentId}/chats?workspace_id={workspaceId}
Response: 200 OK — array of chat session objects.

Create Chat

POST /api/v1/agents/{agentId}/chats?workspace_id={workspaceId}
Creates a new interactive chat session with the agent. Response: 201 Created

Agent Runs

GET /api/v1/agents/{agentId}/runs?workspace_id={workspaceId}
List execution history for an agent. Response: 200 OK — array of run objects.

Agent Proxy Endpoints

These endpoints proxy requests through the crewshipd sidecar to the agent’s container.
EndpointMethodDescription
GET /api/v1/agents/{agentId}/debugGETDebug information for a running agent
GET /api/v1/agents/{agentId}/filesGETList files in agent workspace
GET /api/v1/agents/{agentId}/files/download?path=...GETDownload a file
PUT /api/v1/agents/{agentId}/files/savePUTSave/upload a file
GET /api/v1/agents/{agentId}/container-filesGETList files inside the running container (see below)
GET /api/v1/agents/{agentId}/git-logGETRecent git commits from the container workspace (see below)
GET /api/v1/agents/{agentId}/logsGETGet agent logs
POST /api/v1/agents/{agentId}/stopPOSTStop a running agent

Container Files

GET /api/v1/agents/{agentId}/container-files?subdir={path}
Lists files inside the agent’s running container (as opposed to /files, which lists the persistent workspace mount). Proxied through crewshipd; the request is rejected before the IPC hop if the agent is not assigned to a crew. (internal/api/proxy_files.go:319) Auth: Session or CLI token + workspace membership Query Parameters:
ParameterTypeDescription
subdirstringOptional sub-path within the container’s working directory (normalized to reject .. traversal)
Response: 200 OK — JSON array of file entries (unwrapped from the IPC layer’s {files: [...]} envelope). Returns [] when the sidecar response is unparseable or empty.
StatusCondition
400subdir path is invalid (traversal or absolute)
404Agent not found, or agent not assigned to a crew
502Sidecar IPC call failed

Git Log

GET /api/v1/agents/{agentId}/git-log
Fetches recent git commits from the agent’s container workspace. Proxied through crewshipd; the agent’s slug is forwarded as agent_slug so the sidecar can scope the log to that agent’s directory inside the shared crew container. (internal/api/proxy.go:295) Auth: Session or CLI token + workspace membership Response: 200 OK — JSON array of commit entries (unwrapped from the IPC layer’s {commits: [...]} envelope). Returns [] when the sidecar response is unparseable or empty.
StatusCondition
404Agent not found, or agent not assigned to a crew
502Sidecar IPC call failed

Chat Messages

GET /api/v1/chats/{chatId}/messages
Get messages for a specific chat session. Proxied through crewshipd. Auth: Session or CLI token (auth required, no workspace context needed) Response: 200 OK — array of message objects.