一键导入
api-reference
Full API endpoint reference for SAM. Use when working on API routes, adding endpoints, writing API tests, or understanding the API surface.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Full API endpoint reference for SAM. Use when working on API routes, adding endpoints, writing API tests, or understanding the API surface.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | api-reference |
| description | Full API endpoint reference for SAM. Use when working on API routes, adding endpoints, writing API tests, or understanding the API surface. |
| user-invocable | false |
POST /api/nodes — Create nodeGET /api/nodes — List user's nodesGET /api/nodes/:id — Get node detailsPOST /api/nodes/:id/stop — Stop nodeDELETE /api/nodes/:id — Delete nodeGET /api/nodes/:id/events — List node events (proxied from VM Agent via control plane)GET /api/nodes/:id/system-info — Full system info (proxied from VM Agent)POST /api/nodes/:id/token — Get node-scoped token for direct VM Agent accessPOST /api/workspaces — Create workspaceGET /api/workspaces — List user's workspacesGET /api/workspaces/:id — Get workspace detailsPATCH /api/workspaces/:id — Rename workspace display namePOST /api/workspaces/:id/stop — Stop a running workspacePOST /api/workspaces/:id/restart — Restart a workspaceDELETE /api/workspaces/:id — Delete a workspacePOST /api/projects — Create projectGET /api/projects — List user's projects (supports limit and cursor)GET /api/projects/:id — Get project detail (includes task status counts and linked workspace count)PATCH /api/projects/:id — Update project metadata (name, description, defaultBranch)DELETE /api/projects/:id — Delete project (cascades project tasks/dependencies/events)GET /api/projects/:projectId/sessions — List chat sessions for a projectGET /api/projects/:projectId/sessions/:sessionId — Get chat session detail with recent messagesGET /api/projects/:projectId/sessions/:sessionId/state — Get lightweight ACP activity state for a chat sessionGET /api/projects/:projectId/sessions/:sessionId/messages — List persisted session messages (supports roles, before, limit, compact, order=asc|desc)GET /api/projects/:projectId/sessions/:sessionId/messages/:messageId/tool-content — Lazy-load stored tool content for compact messagesPOST /api/projects/:projectId/sessions/:sessionId/prompt — Send a follow-up prompt to the active agent sessionPOST /api/projects/:projectId/sessions/:sessionId/summarize — Generate a session summary for conversation forkingPOST /api/projects/:projectId/sessions/:sessionId/stop — Stop a chat sessionPOST /api/projects/:projectId/tasks — Create taskGET /api/projects/:projectId/tasks — List tasks (supports status, minPriority, sort, limit, cursor)GET /api/projects/:projectId/tasks/:taskId — Get task detail (includes dependencies + blocked state)PATCH /api/projects/:projectId/tasks/:taskId — Update task fields (title, description, priority, parentTaskId)DELETE /api/projects/:projectId/tasks/:taskId — Delete taskPOST /api/projects/:projectId/tasks/:taskId/status — Transition task statusPOST /api/projects/:projectId/tasks/:taskId/status/callback — Trusted callback status update for delegated tasksPOST /api/projects/:projectId/tasks/:taskId/dependencies — Add dependency edge (dependsOnTaskId)DELETE /api/projects/:projectId/tasks/:taskId/dependencies?dependsOnTaskId=... — Remove dependency edgePOST /api/projects/:projectId/tasks/:taskId/delegate — Delegate ready+unblocked task to owned running workspaceGET /api/projects/:projectId/tasks/:taskId/events — List append-only task status eventsGET /api/admin/tasks/stuck — List tasks currently in transient statesGET /api/admin/tasks/:taskId/reconciliation-diagnostics — Read the TaskRunner probe, task-scoped runtime liveness, eligibility threshold, reconciliation decision, and whether/where the bounded cursor page selects the task, without mutating task stateGET /api/admin/tasks/recent-failures — List recent failed tasks with error detailsGET /api/workspaces/:id/agent-sessions — List workspace agent sessionsPOST /api/workspaces/:id/agent-sessions — Create agent session (optional worktreePath binds session to a worktree)PATCH /api/workspaces/:id/agent-sessions/:sessionId — Rename agent session labelPOST /api/workspaces/:id/agent-sessions/:sessionId/stop — Stop agent sessionGET /api/agent-settings/:agentType — Get user's agent settingsPUT /api/agent-settings/:agentType — Upsert agent settings (model, permissionMode)DELETE /api/agent-settings/:agentType — Reset agent settings to defaultsGET /api/notifications — List notifications (supports cursor, limit, filter, type, projectId, sessionId)GET /api/notifications/unread-count — Get unread notification countPOST /api/notifications/:id/read — Mark a notification as readPOST /api/notifications/read-all — Mark all notifications as readPOST /api/notifications/:id/dismiss — Dismiss a notificationGET /api/notifications/preferences — Get notification preferencesPUT /api/notifications/preferences — Update a notification preferenceGET /api/notifications/ws — WebSocket upgrade for real-time notification deliveryPOST /api/projects/:projectId/triggers — Create a cron, GitHub, or generic webhook trigger. Webhook creation requires agentProfileId and webhookConfig; its response includes a one-time webhookCredential.GET /api/projects/:projectId/triggers — List triggers with safe source configuration. Webhook tokens are redacted to tokenLastFour.GET /api/projects/:projectId/triggers/:triggerId — Get trigger details and recent execution history.PATCH /api/projects/:projectId/triggers/:triggerId — Update common trigger settings or source-specific webhook configuration.DELETE /api/projects/:projectId/triggers/:triggerId — Delete a trigger and cascading source configuration, delivery audit, and execution history.POST /api/projects/:projectId/triggers/:triggerId/test — Preview the cron template context.POST /api/projects/:projectId/triggers/:triggerId/run — Submit a manual trigger execution. Webhook triggers accept optional { payload, headers } preview context.POST /api/projects/:projectId/triggers/:triggerId/webhook/preview — Render a webhook template and evaluate configured filters without creating an execution.POST /api/projects/:projectId/triggers/:triggerId/webhook/rotate — Rotate the webhook bearer token and return the replacement once.GET /api/projects/:projectId/triggers/:triggerId/webhook/deliveries — List redacted webhook delivery audit metadata (limit, cursor).POST /api/webhooks/ingest — Public generic webhook ingress. Requires Authorization: Bearer <token>, Content-Type: application/json, and a JSON object body. Supports optional Idempotency-Key.The MCP create_trigger tool intentionally creates cron triggers only. Generic webhook creation, filter management, preview, and credential rotation use the authenticated UI/REST surface so one-time credentials can be presented safely.
POST /api/nodes/:id/ready — Node Agent ready callbackPOST /api/nodes/:id/heartbeat — Node Agent heartbeat callbackPOST /api/nodes/:id/errors — VM agent error report (batch, logged to CF Workers observability)POST /api/workspaces/:id/ready — Workspace ready callbackPOST /api/workspaces/:id/provisioning-failed — Workspace provisioning failure callback (sets workspace to error)POST /api/workspaces/:id/heartbeat — Workspace activity heartbeat callbackGET /api/workspaces/:id/runtime — Workspace runtime metadata callback (repository/branch for recovery)POST /api/workspaces/:id/boot-log — Workspace boot progress log callbackPOST /api/workspaces/:id/agent-settings — Workspace agent settings callback (model, permissionMode)POST /api/bootstrap/:token — Redeem one-time bootstrap token (credentials + git identity)POST /api/agent/ready — VM agent ready callbackPOST /api/agent/activity — VM agent activity reportPOST /api/terminal/token — Get terminal WebSocket tokenGET /workspaces/:id/worktrees — List git worktrees for the workspacePOST /workspaces/:id/worktrees — Create a git worktreeDELETE /workspaces/:id/worktrees?path=...&force=true|false — Remove a git worktreeGET /workspaces/:id/git/status?worktree=... — Git status (staged, unstaged, untracked files)GET /workspaces/:id/git/diff?path=...&staged=true|false&worktree=... — Unified diff for a single fileGET /workspaces/:id/git/file?path=...&ref=HEAD&worktree=... — Full file contentGET /workspaces/:id/files/list?path=.&worktree=... — Directory listingGET /workspaces/:id/files/find?worktree=... — Recursive flat file indexPOST /api/transcribe — Transcribe audio via Workers AI (Whisper)POST /api/client-errors — Receive batched client-side errors for Workers observability loggingPOST /api/auth/sign-in/social — GitHub OAuth loginGET /api/auth/session — Get current sessionPOST /api/auth/sign-out — Sign outGET /api/credentials — Get the user's cloud provider connections. GCP returns safe authType, project, service-account email, zone, and optional key ID metadata; encrypted source credentials are never returned, and malformed rows are isolated.POST /api/credentials — Save a cloud provider credential. New GCP WIF writes use the versioned workload-identity variant.DELETE /api/credentials/:provider — Delete the stored cloud provider credential. GCP deletion atomically removes legacy and generated composable copies and cached derivatives; it does not revoke Google-managed keys.PUT /api/gcp/service-account — Validate and atomically save or rotate an OAuth-free service-account JSON credential. Body: { serviceAccountJson, defaultZone }. Verification and the mutation rate limit run before replacement; the response contains safe metadata only.POST /api/gcp/setup — Complete the recommended keyless WIF setup using an OAuth handle and store the versioned WIF credential.POST /api/gcp/projects — List Google Cloud projects for a short-lived infrastructure OAuth handle.POST /api/gcp/verify — Verify the currently stored GCP credential, dispatching to WIF or service-account authentication.The service-account flow ignores uploaded endpoint fields and exchanges RS256 assertions only at SAM's fixed Google token endpoint.
GET /api/github/installations — List user's GitHub App installationsGET /api/github/repositories — List accessible repositoriesGET /api/github/branches?repository=owner/repo — List branches for a repositoryAll API errors follow this format:
{
error: "error_code",
message: "Human-readable description"
}
Cloudflare Workers architecture specialist. Advises on D1 migrations, KV usage patterns, R2 binary distribution, wrangler configuration, and Miniflare testing. Use when modifying wrangler.toml, working with Cloudflare services, or setting up testing infrastructure.
Constitution compliance validator focusing on Principle XI (No Hardcoded Values). Detects hardcoded URLs, timeouts, limits, and identifiers that should be configurable. Use proactively when implementing business logic, adding new features, or reviewing PRs for constitution compliance.
End-to-end autonomous task executor. Takes a task description and handles the full lifecycle: research, plan, implement, review with specialist skills, and merge via PR. Use when given a task to execute end-to-end.
Documentation synchronization validator. Ensures CLAUDE.md, self-hosting.md, constitution.md, and other docs match actual code implementation. Checks for stale references, missing documentation, and inconsistent descriptions. Use proactively when modifying code interfaces, adding features, or updating documentation.
Environment variable consistency validator. Checks GH_* vs GITHUB_* naming conventions, validates documentation matches code, and ensures deployment scripts correctly map secrets. Use proactively when modifying environment variables, updating CLAUDE.md, editing configure-secrets.sh, or changing the Env interface.
Identify what to work on next. Reconciles candidate work against already-merged code BEFORE ranking, so stale/shipped ideas are dropped. Use when asked what to work on next, how to prioritize the backlog, or to triage ideas/tasks/incidents into a ranked shortlist.
基于 SOC 职业分类