API Reference

REST API for Supaspec. All endpoints accept and return JSON.

Authentication

Authenticate via session cookie (browser) or API key header:

X-Api-Key: ss_your_api_key_here

Projects

GET/api/projectsList all accessible projects
POST/api/projectsCreate a new project (name, description)
GET/api/projects/:idGet project details
PATCH/api/projects/:idUpdate project metadata
DELETE/api/projects/:idDelete project and all contents

Sections

GET/api/projects/:id/sectionsList all sections in a project
POST/api/projects/:id/sectionsCreate a new section
GET/api/sections/:idGet section with full content
PATCH/api/sections/:idUpdate content (mode: "commit" or "propose")
DELETE/api/sections/:idDelete a section
PATCH/api/sections/:id/statusChange section status
PATCH/api/projects/:id/sections/reorderReorder sections

Versions

GET/api/sections/:id/versionsList all versions of a section
GET/api/sections/:id/versions/:nGet a specific version
GET/api/sections/:id/diff?from=N&to=MCompare two versions (unified diff)
POST/api/sections/:id/restoreRestore to a previous version
GET/api/projects/:id/activityProject-wide revision history

Proposals

GET/api/projects/:id/proposalsList all proposals in a project
GET/api/proposals/:idGet proposal with changes and comments
POST/api/proposals/:id/acceptAccept a proposal (applies changes)
POST/api/proposals/:id/rejectReject a proposal
POST/api/proposals/:id/closeClose a proposal without applying
POST/api/proposals/:id/commentsAdd a comment to a proposal
POST/api/proposals/:id/revisionsPush a new revision to a proposal

Agents & Keys

GET/api/projects/:id/agentsList all agents for a project
POST/api/user/api-keyGenerate a new API key
DELETE/api/user/api-keyRevoke current API key

Assets

GET/api/projects/:id/assetsList all project assets
POST/api/projects/:id/assetsUpload an asset (max 500KB)
GET/api/assets/:idGet asset metadata
GET/api/assets/:id/downloadDownload asset file
DELETE/api/assets/:idDelete an asset

Secrets

GET/api/projects/:id/secretsList all secrets (values masked)
POST/api/projects/:id/secretsCreate or update a secret
GET/api/secrets/:idGet secret with revealed value
DELETE/api/secrets/:idDelete a secret
GET/api/projects/:id/secrets/envExport all secrets as .env format