API Reference

REST API reference for all Supaspec endpoints. Build custom integrations beyond MCP.

Authentication

All API requests require authentication via one of:

  • Session cookie — for web UI requests (set by Stytch auth)
  • API key header — for programmatic access
X-Api-Key: ss_your_api_key_here

Projects

POST /api/projects

Create a new project.

Body:

{
  "name": "Optimus",
  "description": "Main product implementation spec"
}

GET /api/projects

List all projects accessible to the authenticated user.

GET /api/projects/:id

Get a single project by ID.

PATCH /api/projects/:id

Update project name, description, or settings.

DELETE /api/projects/:id

Delete a project and all its sections, versions, and activity.


Sections

POST /api/projects/:id/sections

Create a new section in a project.

Body:

{
  "title": "Architecture Overview",
  "content": "## Architecture\n...",
  "status": "draft",
  "message": "Initial architecture draft",
  "agent_name": "claude_code"
}

GET /api/projects/:id/sections

List all sections in a project (without content).

GET /api/sections/:id

Get a single section with full content.

PATCH /api/sections/:id

Update section content. Creates a new version.

Body:

{
  "content": "Updated markdown content...",
  "message": "Add caching strategy for API calls",
  "description": "Added Redis caching layer for frequently accessed endpoints",
  "mode": "commit",
  "agent_name": "claude_code"
}

DELETE /api/sections/:id

Delete a section and all its versions.

PATCH /api/sections/:id/status

Change a section's status.

Body:

{
  "status": "approved",
  "message": "Approved after team review",
  "agent_name": "claude_code"
}

PATCH /api/projects/:id/sections/reorder

Reorder sections within a project.

Body:

{
  "order": ["section-id-1", "section-id-2", "section-id-3"]
}

Versions

GET /api/sections/:id/versions

List all versions for a section.

GET /api/sections/:id/versions/:version

Get a specific version with full content and metadata.

GET /api/sections/:id/diff?from=N&to=M

Get a unified diff between two versions.

PATCH /api/sections/:id/versions/:version

Accept or reject a proposal.

Body:

{
  "action": "accept"
}

or

{
  "action": "reject",
  "reason": "The proposed caching strategy conflicts with our real-time requirements"
}

GET /api/projects/:id/versions

Get the full project revision log across all sections.

GET /api/projects/:id/proposals

List all pending proposals across all sections.


Agents

GET /api/projects/:id/agents

List all agents that have interacted with a project.

GET /api/agents/:id

Get agent details.

GET /api/agents/:id/stats

Get agent statistics: versions created, proposals made/accepted, last active.

GET /api/agents/:id/activities

Get activity log for a specific agent.


Activity

GET /api/projects/:id/activities

Get the project activity log. Filterable by query parameters:

Param Description
agent_id Filter by agent
action Filter by action type
from Start date (ISO 8601)
to End date (ISO 8601)

Members

POST /api/projects/:id/members

Invite a member to a project.

Body:

{
  "email": "collaborator@example.com",
  "role": "editor"
}

GET /api/projects/:id/members

List project members.

PATCH /api/projects/:id/members/:uid

Update a member's role.

DELETE /api/projects/:id/members/:uid

Remove a member from a project.


Search

GET /api/projects/:id/search?q=...

Full-text search across all sections in a project.


API Key Management

POST /api/user/api-key

Generate a new API key (replaces any existing key).

Response:

{
  "key": "ss_a3b2c4d5e6f7...",
  "prefix": "ss_a3b2",
  "created_at": "2026-02-17T10:00:00Z"
}

The full key is shown only once. Store it securely.

DELETE /api/user/api-key

Revoke the current API key.