Scripto docs
View as Markdown

API overview

The Scripto HTTP API — base URL, the response envelope, error codes and statuses, per-user scoping, and the full endpoint index with matching CLI commands.

For almost everything, the scripto CLI is the right interface — it wraps these routes and handles auth, profiles, and the section loop for you. Use the HTTP API directly only when you genuinely can’t run the CLI.

Base URL

https://scripto.codika.io

All routes live under /api. There is no URL versioning.

The envelope

Every data route returns a discriminated envelope, paired with an appropriate HTTP status:

{ "success": true, "data": { "…": "…" } }
{ "success": false, "error": { "code": "not-found", "message": "Article not found.", "nextAction": "Call GET /outline …" } }

The CLI decodes web and CLI responses identically against this contract. nextAction is an optional machine-readable hint — pass it through verbatim.

Error codes

codeHTTPMeaning
unauthenticated401Missing or invalid key.
invalid-argument400Bad/missing field, ambiguous anchor, wrong type.
not-found404No such resource or you don’t own it (no existence leak).
internal500Backend error — retry with backoff.

Per-user scoping

Every article, section, and note is scoped to the authenticated user. A resource you don’t own returns 404, never 403 — Scripto never reveals that an id exists. This is identical across the session, Bearer-key, and OAuth auth paths.

Endpoint index

Method & pathCLI equivalentPage
POST /api/cli/login-requestscripto auth login-requestCLI auth
POST /api/cli/login-completescripto auth login-completeCLI auth
GET /api/auth/mescripto whoamiwhoami
GET /api/articlesscripto articles listlist
POST /api/articles(part of articles create)create
GET /api/articles/[id]scripto articles getget
PATCH /api/articles/[id]scripto articles updateupdate
DELETE /api/articles/[id]delete
GET /api/articles/[id]/outlinescripto outlineoutline
POST /api/articles/[id]/publishscripto articles publishpublish
POST /api/articles/importscripto articles importimport
POST /api/articles/[id]/sectionsscripto section addadd section
GET /api/articles/[id]/sections/[sid]scripto section getget section
PATCH /api/articles/[id]/sections/[sid]scripto section setupdate section
DELETE /api/articles/[id]/sections/[sid]scripto section rmdelete section
POST /api/articles/[id]/sections/[sid]/movescripto section mvmove section
GET /api/articles/[id]/briefscripto briefget brief
PATCH /api/articles/[id]/briefscripto brief --premiseset premise
GET /api/articles/[id]/notesscripto note listlist notes
POST /api/articles/[id]/notesscripto note addadd note
GET /api/articles/[id]/notes/[nid]scripto note getget note
PATCH /api/articles/[id]/notes/[nid]scripto note setupdate note
DELETE /api/articles/[id]/notes/[nid]scripto note rmdelete note
GET /api/keys— (web Settings)list keys
POST /api/keys— (web Settings)create key
DELETE /api/keys/[id]— (web Settings)revoke key
POST /api/uploadupload image
GET /api/unfurlunfurl

Next