Skip to main content

Find browser API routes

Routes live in web/api. This page is the original flat index; the API Reference section covers chat, approvals, prompt control, inbound email, portfolio, documents, availability/calendar, admin/environment/costs, and feedback in family-by-family depth. The customer portal API covers the complete workspace, access, review, file, plan, notification, and assistant contracts.

RouteMethodsPurposeAuth
/api/configGETPublic browser configPublic; returns public Supabase URL/anon only
/api/spineGETScoped spine payloadSupabase JWT in live mode
/api/chatPOSTAsk SABLE scoped Q&ASupabase JWT in live mode; legacy token only in demo mode
/api/searchPOSTScoped knowledge search over chunksSupabase JWT
/api/docGETSigned document URLSupabase JWT
/api/doc-upload-sessionPOSTAllocate document row and signed upload tokenSupabase JWT
/api/document-inventoryGETAdmin indexed-doc and contract-extraction inventorySupabase JWT; admin/lead
/api/meeting-deleteGET, POSTPreview and confirm permanent meeting deletion; read minimal status/history receiptsSupabase JWT; organization admin
/api/inboxGETPending approval cardsSupabase JWT in live mode
/api/client-contactsPOSTSave a client-level contact from an email draft card (action: save), or remove one (action: remove)Supabase JWT; save: a lead or anyone on a project for the client; remove: a lead or the person who saved it
/api/gmail-draftPOSTSave a chat email draft to the signed-in person's own Gmail Drafts (forwards to the gmail-draft Edge function; never sends)Supabase JWT; staff; refused under View as someone else
/api/email-draft-reviewPOSTFile a chat email draft as a pending email_draft approval ("Send for review"); sends nothingSupabase JWT; any signed-in person, on projects they can see
/api/approvalsGET, POSTApproval list/mutate/executeSupabase JWT; writes admin/lead
/api/sable-promptPOSTLead-only prompt read, stage, promote, history, and rollback bridgeSupabase JWT; admin/lead
/api/outcomeGETOutcome estimateSupabase if configured
/api/estimate-casesPOSTPersist an outcome estimate caseSupabase JWT; admin/lead
/api/updates/draftPOSTCreate a weekly/client update approval draftSupabase JWT; admin/lead
/api/deliverable-draftsGET, POSTLoad scoped drafts or generate an evidence-backed deliverable draft and approvalSupabase JWT; admin/lead
/api/client-portalGET, POSTScoped portal workspace plus request and internal-note mutationsSupabase JWT; staff actions require exact scope
/api/portal-accessGET, POSTMembership roster, invitation, resend, recovery, and revocationSupabase JWT; admin/lead
/api/portal-assistantPOSTAnswer from authorized released workspace evidenceSupabase JWT
/api/portal-attachmentsGET, POSTPrepare, validate, complete, and download private request filesSupabase JWT; request scope
/api/portal-filesGET, POSTGET ?download=: a 60-second download link for a shared document the portal shows the viewer; POST: prepare and complete a customer upload to a current project's LibrarySupabase JWT; client scope and project; downloads re-checked with list_portal_resources
/api/portal-milestonesPOSTCreate or update customer-visible shared milestonesSupabase JWT; scoped staff
/api/portal-notificationsGET, POST, PUTPerson-scoped inbox, read state, and notification preferencesSupabase JWT; current client scope
/api/portal-publicationsGET, POSTStaff publication inventory, explicit resource share/withdraw, and direct customer updatesSupabase JWT; staff browse, admin/lead writes
/api/portal-linksGET, POST, PUT, DELETEImportant links for a customer: list, add, edit or reorder (PUT), archive (DELETE)Supabase JWT; read by admin/lead or a customer member of the client (consultants cannot read links), writes admin/lead
/api/portal-preparationGET, PUT, POSTStarter-package preparation. With section=policy, reads (GET) and saves (PUT) the client's tabs, landing tab, auto-share, recording-link, weekly-draft and backfill settings; POST is not allowed for the policy sectionSupabase JWT; preparation read and save by scoped staff (admin, lead, or a consultant on one of the client's active projects), apply (POST) admin/lead, policy read and write admin/lead
/api/deliverable-releasePOSTRecheck approved source-draft QA and create one immutable current portal version, review state, receipt, and notificationsSupabase JWT; admin/lead
/api/deliverable-reviewsPOSTComment on or decide one current released versionSupabase JWT; decision capability required for approve/change requests
/api/whoamiGETCurrent viewerSupabase JWT
/api/boardGETLegacy CMA board HTMLDemo-only; disabled in production mode
/api/ingestPOSTLegacy transcript-drop CMA runDemo-only; disabled in production mode
/api/statusGETLegacy CMA session statusDemo-only; disabled in production mode
/api/fathom-webhookPOSTLegacy CMA-memory webhookDemo-only shared secret
/api/ingest-docPOSTExtract, chunk, embed, and index an uploaded documentSupabase JWT

In SABLE_MODE=production, routes with no Supabase configuration fail closed instead of serving bundled demo JSON or CMA memory-store data.

Meeting deletion route​

GET /api/meeting-delete?source_id=<uuid> returns meeting identity, provider, an opaque snapshot token, dependency counts and explicit consequences. It never returns the transcript, attendee list or provider URL. POST /api/meeting-delete confirms the current preview:

{
"action": "confirm",
"source_id": "meeting-source-uuid",
"expected_version": "opaque-preview-token",
"reason_code": "private_recording",
"acknowledge_content_redaction": true
}

Valid reasons are private_recording, accidental_import, duplicate and other. The server takes organization and actor only from the verified session, and the database verifies both again. A stale snapshot returns 409; cross-organization and absent meetings both return 404. Completion is synchronous and atomic. GET ?receipt_id=<uuid> reads one minimal receipt and GET ?history=1 returns the newest organization receipts. There is no deletion retry action or provider deletion call in this route.

When the preview counts linked task, decision or promise redactions, or a deliverable, brief, summary, artifact, document, obligation, status update or board withdrawal, the dialog requires an additional acknowledgment. Linked operational rows keep their identity/status shells while their text, people and URLs are redacted. Affected mixed-source draft bodies are fully withdrawn and must be rebuilt from the remaining sources; their unrelated evidence links and relationships remain. The confirm RPC enforces this boolean against its locked dependency snapshot, so a direct API call cannot bypass the acknowledgment.

Approval Route Actions​

{ "action": "approve", "id": "approval-uuid" }
{ "action": "approve_and_execute", "id": "approval-uuid" }
{ "action": "reject", "id": "approval-uuid", "reason": "not needed" }
{ "action": "edit", "id": "approval-uuid", "payload": { "text": "Edited" } }
{ "action": "batch_approve", "ids": ["approval-uuid"] }
{ "action": "execute", "id": "approval-uuid" }

Only asana_task_create approvals execute external writes today. weekly_update, scope_change, sow_draft, and client_readout mutate only SABLE-owned tables. Approved deliverable drafts normally require a separate admin/lead Release to client action in Draft Workbench, which calls /api/deliverable-release and creates the immutable portal version. Approving a legacy deliverable_release record invokes the same gated immutable release through release_deliverable_approval_to_portal; it does not merely flip base visibility. prompt_update folds approved learned rules into the live agent prompt. email_draft, scope_flag, and sow_estimate remain approval/audit records until their delivery paths are implemented.

Prompt Control Route Actions​

{ "action": "get_prompt" }
{ "action": "stage_prompt", "base": "candidate base prompt" }
{ "action": "set_base_prompt", "base": "approved base prompt" }
{ "action": "prompt_versions" }
{ "action": "rollback_prompt", "version_row_id": "version-row-uuid" }

POST /api/deliverable-drafts accepts optional authoring_profile_id or profile_key. When present, the route applies the profile's section requirements, source collection policy, standing facts, client-facing language rubric, canonical target, and revision-history rules. Canonical export details are returned and stored as metadata; the route still queues approval only and does not overwrite external files.

Outcome Response Shape​

{
"query": "hubspot migration",
"no_data": false,
"typical_hours": 150,
"range_hours": [100, 200],
"duration_weeks": [8, 12],
"category": "crm_migration",
"budget_variance_hours": { "average": 5, "range": [-10, 20] },
"financials": {
"average_margin_percent": 46,
"average_revenue": 21500,
"average_cost": 11700
},
"confidence": "Medium",
"comparables": [],
"scope_signals": {
"completed_after_hours": [],
"recent_burn_hours": 12.5
},
"assumptions": []
}