constitute.

Agent API

A bearer-token REST API for agents and scripts. Base URL: https://constitute.splashstudio.ai/api/v1. The tenant is derived from the key. Bodies are JSON, success bodies start with "version": 1, and failures are { "error": "…" }.

curl https://constitute.splashstudio.ai/api/v1/state \
  -H "Authorization: Bearer cst_live_…"

Routes

RouteScopeNotes
GET /api/v1/statestate:readCounts, lanes, Convention progress, amendments.pending, warnings.
GET /api/v1/draftsdrafts:readList drafts.
POST /api/v1/draftsdrafts:writeCreate a draft. Idempotent with clientRequestId. Returns 412 until the Bill of Rights is complete.
POST /api/v1/drafts/{id}/ratifydrafts:decideRatify.
POST /api/v1/drafts/{id}/vetodrafts:decideVeto, with an optional reason.
POST /api/v1/drafts/{id}/editdrafts:decideEdit the text.
POST /api/v1/drafts/{id}/mark-posteddrafts:decideMark a manual-lane draft as posted.
POST /api/v1/drafts/{id}/publish-nextdrafts:decidePublish the next ratified draft.
GET /api/v1/kpiskpis:readRatified-as-drafted rate and friends.
GET /api/v1/amendmentsamendments:decide or state:readList amendments.
POST /api/v1/amendments/{id}/accept | rejectamendments:decideDecide. Accepting applies it.
PATCH /api/v1/amendments/{id}amendments:decideEdit proposed text, type, target or mode.
GET /api/v1/corpus/searchcorpus:readHybrid search across your Articles.
GET /api/v1/constitutioncorpus:readThe always-on context.
POST /api/v1/corpus/proposecorpus:proposePropose an entry (a pending amendment).
POST /api/v1/conventionconvention:runSame state machine as run_convention.
POST /api/v1/sessionconvention:runSame state machine as run_session.

Submit a draft

curl -X POST https://constitute.splashstudio.ai/api/v1/drafts \
  -H "Authorization: Bearer cst_live_…" \
  -H "Content-Type: application/json" \
  -d '{"platform":"linkedin","title":"Why we did not raise",
       "body":"…","citedEntryIds":["<article-id>"],
       "clientRequestId":"2026-w41-post-1"}'

Status codes

StatusMeaning
400Bad input.
401Missing, revoked or unknown key. Fails closed.
402Plan limit reached.
403The key lacks the required scope.
404No such id.
409It moved on; the record changed since you read it.
412Drafting is locked until the Bill of Rights is complete.

Replay and idempotency

Decisions are replay-safe: ratifying an already ratified draft returns 200 with noop: true. Draft creation is idempotent on clientRequestId.

What this API will not do