Scripto docs
View as Markdown

GET /api/articles/[id]/outline

The cheap section map of an article — one entry per section (anchor, level, title, word count, source), never the bodies. Backs scripto outline.

The CLI equivalent is scripto outline <id>. This is the route an agent reads before editing a single section.

Returns the cheap map of a story: one entry per section, never the bodies. It stays tiny no matter how long the article grows — the right thing to read before editing one section.

Endpoint

GET https://scripto.codika.io/api/articles/{id}/outline

Auth

Authorization: Bearer scripto_…

Response (200)

{
  "success": true,
  "data": {
    "article": { "id": "0a1b2c3d-…", "title": "Our launch", "status": "draft", "wordCount": 1240 },
    "outline": [
      { "anchor": "a1b2c3d4", "level": 1, "title": "Our launch", "words": 52, "source": "markdown" },
      { "anchor": "e5f6a7b8", "level": 2, "title": "What changed", "words": 318, "source": "markdown" }
    ]
  }
}

Each outline entry: anchor (the first 8 chars of the section id — any unique prefix works as an anchor), level (heading level), title, words, and source (markdown or html).

Errors

HTTPcodeCause
401unauthenticatedMissing or invalid key.
404not-foundNo such article, or you don’t own it.
500internalBackend error.

curl

curl -sS "https://scripto.codika.io/api/articles/$ID/outline" \
  -H "Authorization: Bearer $SCRIPTO_API_KEY"

Next