Skip to content

REST API overview

What this is

The ComStack REST API — the HTTP surface the MCP server is built on. It covers page management, publishing, live voice sessions, project configuration, authentication, and templates.

Base URL: https://api.comstack.ai

The MCP server wraps these same operations. If you’re using Claude, Cursor, or another MCP client, you don’t need to call the REST API directly. Use it when integrating from a custom server, webhook, or CI pipeline.

How it works

Authentication

Two methods:

  • OAuth Bearer token — for user accounts. Obtained via the OAuth flow; send as Authorization: Bearer <token>. See Authentication reference.
  • Service API key — for headless callers. Set x-project-id and x-api-key headers. Generate keys in project settings.

Response format

Successful responses return JSON. Errors return { "error": "..." }:

StatusMeaning
400Invalid request — missing or malformed arguments
401Authentication required
403Insufficient role, module disabled, or trial expired
404Resource not found
413Payload too large (1 MB general; 10 MB image upload)
429Rate limit exceeded
500Internal error

Rate limits

Per-IP, 60-second sliding window:

EndpointLimit
POST /mcp60 requests/min
/oauth/*30 requests/min
Auth failures (401 responses)10/min before 429 kicks in

Endpoint groups

OAuth and authentication

/.well-known/oauth-authorization-server, /oauth/register, /oauth/authorize, /oauth/token

Projects

GET/POST /api/projects, GET/PATCH/DELETE /api/projects/:id, members, domains, modules, settings

Pages (knowledge)

Create, edit (/docs/edit/open, /edit/save, /edit/discard), list, publish flow, visibility

Custom pages

POST /api/projects/:id/docs/edit/upload-custom-page — for HTML/Astro custom page bodies

Publishing

POST /api/projects/:id/publish, POST .../publish/confirm, GET .../publish/history

Publishing is a two-step flow: dry-run builds a manifest + confirmation token; confirm promotes and deploys. See Publish reference.

Live voice

POST /api/live/session, /session/resume, /tools/execute, /twilio/voice

/api/projects/:id/sidebar-groups, /api/projects/:id/header-nav-items

Templates

/api/templates/doc, /api/templates/project, /api/projects/:id/templates

Ingestion (Chrome Extension)

/api/projects/:id/ingest/* — capture, extract, and save pages from the Chrome extension

API keys

/api/projects/:id/keys

Account

/api/accounts/me, /api/account/connectors/claude/*

When to use it

Use caseRecommended path
AI assistant managing contentMCP server — the tools abstract the API and handle auth
Server-side integration, CI/CDREST API — more control, no MCP client dependency
Webhook receiverREST API

Example

Fetch project details with a Bearer token:

Terminal window
curl https://api.comstack.ai/api/projects/YOUR_PROJECT_ID \
-H "Authorization: Bearer YOUR_TOKEN"

Call the MCP endpoint with a service key:

Terminal window
curl -X POST https://api.comstack.ai/mcp \
-H "Content-Type: application/json" \
-H "x-project-id: YOUR_PROJECT_ID" \
-H "x-api-key: YOUR_SERVICE_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get-project-state","arguments":{"project_id":"YOUR_PROJECT_ID"}}}'

Common errors

ErrorCauseFix
401 UnauthorizedMissing or expired tokenRe-authenticate or regenerate the API key
403 Trial expiredThe project’s trial period endedUpgrade the plan to restore access
403 Insufficient permissionCaller’s role is below the endpoint’s requirementCheck your role and ensure you’re calling with the right credentials
413 Payload Too LargeRequest body exceeds the limitReduce payload size or use the chunked image upload endpoint
429 Too Many RequestsRate limit hitBack off and retry after the Retry-After header value

Last updated: