Special Launch Pricing 25% off

View pricing

About 18 min read

Workspace API and MCP

Bearer-authenticated REST (/api/ext/v1) and Model Context Protocol (/api/ext/mcp) on your tenant runtime: scoped tasks and agents, Streamable HTTP MCP tools, webhooks, IP allowlists, per-key rate limits, and owner key management (paid plans).

Overview

Smart AI Team exposes two integration surfaces on each workspace’s tenant runtime: a versioned REST API (/api/ext/v1) and a Model Context Protocol server (POST /api/ext/mcp). Use the tabs below to focus on REST or MCP—shared concepts (keys, auth, base URL) are on this page.

Both surfaces use the same workspace API keys (Bearer tokens), the same scopes, and the same per-key policy (IP allowlist and requests-per-minute).

Keys are owner-only. Create them under Health → Workspace API (Advanced); the secret is shown once and stored hashed on the server. Browser login stays on cookies; integrations use keys.

A paid workspace plan is required for external calls. Without it, the API responds with a clear premium error code.

Where requests go

  • Base URL is always your workspace origin—for example https://your-workspace.app.smartaiteam.com or the hostname your operator mapped—not the control-plane app URL.
  • REST lives under /api/ext/v1. MCP uses POST /api/ext/mcp (Streamable HTTP). These paths bypass browser session middleware; authentication is enforced inside the handlers via your Bearer key.
  • The control plane provisions workspaces; it does not proxy these routes. That separation keeps tenant isolation sharp.

Authentication

Send Authorization: Bearer <secret> on every external request. Secrets use the sat_wk_live_ prefix. Start with GET /api/ext/v1/status to confirm the key, label, and scopes.

curl -sS -H "Authorization: Bearer sat_wk_live_YOUR_SECRET" \
  "https://YOUR_WORKSPACE_HOST/api/ext/v1/status"

Reference

Scopes

Grant the smallest set your integration needs. Missing scope returns 403 with a message naming the required scope. Keys are configured in the product by ticking capability groups; each maps to the granular scopes below.

  • Task board: tasks:read (list tasks, get one task with comments), tasks:create, tasks:update, tasks:delete, tasks:comments:write (same comment pipeline as the in-app task board, including notifications when applicable).
  • Agents: agents:read (list agents and metadata), agents:ping (pulse wake with optional message), agents:heartbeat (short online check via the agent runtime), agents:message (dedicated API chat session per key and agent; counts against workspace usage like in-app chat).

REST API reference

Successful responses are JSON with ok: true and a payload; errors use ok: false plus error and optional code. Validation issues may include an issues array from the schema layer.

  • GET /api/ext/v1/status — connectivity and key metadata (no extra scope).
  • GET /api/ext/v1/tasks — tasks:read. Returns tasks and snapshot.updatedAt when sourced from snapshot read models.
  • POST /api/ext/v1/tasks — tasks:create. Body: title (required), optional description, status, priority, requiresApproval, storyPoints (nullable), projectId (nullable), assigneeIds, dueAt (ISO datetime or null).
  • GET /api/ext/v1/tasks/:id — tasks:read. Returns task, comments, snapshot metadata.
  • PATCH /api/ext/v1/tasks/:id — tasks:update. Body may include any of: title, description, status, priority, requiresApproval, storyPoints, projectId, assigneeIds, subscriberIds, docIds, dueAt.
  • DELETE /api/ext/v1/tasks/:id — tasks:delete.
  • POST /api/ext/v1/tasks/:id/comments — tasks:comments:write. Body: content (required), optional author (defaults to api).
  • GET /api/ext/v1/agents — agents:read.
  • POST /api/ext/v1/agents/:id/ping — agents:ping. Optional JSON body: message (wake text).
  • POST /api/ext/v1/agents/:id/heartbeat — agents:heartbeat. Optional JSON body: prompt (defaults to a short online confirmation).
  • POST /api/ext/v1/agents/:id/message — agents:message. Body: text. Disabled agents return 404 as not found.

Webhooks

Optional HTTPS URL per key. On task lifecycle events the runtime POSTs a JSON envelope (event name, tenant id, key id, timestamp, payload).

If you configure a signing secret, verify header X-SAT-Signature: sha256=<hex HMAC-SHA256 of the raw body>.

Subscribe per event: task.created, task.updated, task.deleted, task.comment.created, or * for all. Delivery is best-effort with a short timeout—design your endpoint to be idempotent.

Key management and audit (session auth)

While signed in as the workspace owner on the same origin, use session-authenticated routes (not the Bearer key): GET and POST /api/workspace-api/keys, PATCH /api/workspace-api/keys/:id, DELETE to revoke.

GET /api/workspace-api/audit?limit=… returns a read-only tail of external requests: method, path, status, key label, client IP, duration—useful for compliance and debugging.

Per-key policy and operator controls

  • IP allowlist: optional exact IPs or IPv4 CIDRs. Other clients get 403 WORKSPACE_API_IP_DENIED. The runtime uses the first hop of X-Forwarded-For when present (typical behind Cloud Run or a reverse proxy).
  • Rate limit: configurable requests per minute per key, enforced in rolling one-minute windows; exceeded returns 429 WORKSPACE_API_RATE_LIMIT.
  • Operator disable: when the tenant runtime sets the workspace external API disabled flag, both REST and MCP return 503 with a service-unavailable message.
  • Operators may also set a default RPM for new keys; key pepper material for hashing is configured server-side.

HTTP status and error codes

  • 400 — invalid JSON body or schema validation (issues may be included).
  • 401 — missing Bearer token, invalid secret, or revoked key.
  • 402 — PLAN_LIMIT_REACHED on agent heartbeat or message when workspace usage limits apply.
  • 403 — WORKSPACE_API_PREMIUM_REQUIRED (free plan), WORKSPACE_API_IP_DENIED (allowlist), WORKSPACE_API_MCP_DISABLED (MCP off for key), or missing scope (explicit scope name in message).
  • 404 — task or agent not found where applicable.
  • 405 — wrong HTTP method (for example GET on /api/ext/mcp).
  • 429 — WORKSPACE_API_RATE_LIMIT.
  • 503 — Workspace API disabled by operator on this runtime.

Examples (REST)

curl -sS -H "Authorization: Bearer sat_wk_live_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"title":"From API","status":"todo"}' \
  "https://YOUR_WORKSPACE_HOST/api/ext/v1/tasks"
curl -sS -H "Authorization: Bearer sat_wk_live_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"content":"Ship checklist is green."}' \
  "https://YOUR_WORKSPACE_HOST/api/ext/v1/tasks/TASK_ID/comments"
curl -sS -X PATCH -H "Authorization: Bearer sat_wk_live_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"status":"done"}' \
  "https://YOUR_WORKSPACE_HOST/api/ext/v1/tasks/TASK_ID"
  • What is Smart AI Team? — Smart AI Team is the operational home for your AI workforce—workspaces, agents, tasks, and governed execution in one place.
  • The AI operating layer for teams — Why a chat window is not enough, and how Smart AI Team maps intelligence onto real org structure and workflows.
  • How it works — Control plane, tenant runtimes, sessions, skills, and channels—how the pieces fit without sacrificing isolation.
  • Workspaces and tenants — Per-customer runtimes, branded domains, SSO handoff, and why isolation is a product feature—not an afterthought.
  • Documentation overview