Scripto docs
View as Markdown

GET /api/articles/[id]/sections/[sid]

Fetch one section's body — Markdown when agent-authored, always the rendered HTML — addressed by anchor. Backs scripto section get.

The CLI equivalent is scripto section get <id> <anchor> (-o <file> to write the body to disk).

Returns one section’s body. sid is a section anchor — any unique prefix of the section id. source tells you which form is canonical: markdown for agent-authored sections, html for sections edited in the human canvas.

Endpoint

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

Auth

Authorization: Bearer scripto_…

Response (200)

{
  "success": true,
  "data": {
    "section": {
      "id": "e5f6a7b8-…",
      "anchor": "e5f6a7b8",
      "level": 2,
      "title": "What changed",
      "words": 318,
      "source": "markdown",
      "markdown": "## What changed\n\n…",
      "html": "<h2>What changed</h2>…"
    }
  }
}

For an html-authored section, markdown is null and html is canonical.

Errors

HTTPcodeCausenextAction
400invalid-argumentThe anchor is ambiguous.Use a longer anchor.
404not-foundNo such article, or no section matches the anchor.Call GET /outline for current anchors.
401unauthenticatedMissing or invalid key.

curl

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

Next