Scripto docs
View as Markdown

PATCH /api/articles/[id]/notes/[nid]

Update one or more of a note's fields — kind, title, body, url. Only the fields you pass change. Backs scripto note set.

The CLI equivalent is scripto note set <id> <anchor> [--kind …] [--title …] [--url …|--clear-url] [--body …|--clear-body].

Updates one or more of a note’s fields. Only the fields you pass change. nid is a note anchor.

Endpoint

PATCH https://scripto.codika.io/api/articles/{id}/notes/{nid}

Auth

Authorization: Bearer scripto_…

Request

At least one of:

FieldTypeMeaning
kindstringOne of source, decision, idea, question.
titlestringNon-empty.
bodystring | nullnull clears it.
urlstring | nullnull clears it.
{ "title": "Lead with the install", "url": null }

Response (200)

{
  "success": true,
  "data": {
    "note": { "anchor": "1a2b3c4d", "kind": "decision", "title": "Lead with the install", "…": "…" },
    "notes": [ "… the fresh notes map …" ]
  }
}

Errors

HTTPcodeCausenextAction
400invalid-argumentNothing to change; unknown kind; empty title; wrong type; or ambiguous anchor.Use a longer anchor.
404not-foundNo such article, or no note matches the anchor.Call GET /notes for current anchors.
401unauthenticatedMissing or invalid key.

curl

curl -sS -X PATCH "https://scripto.codika.io/api/articles/$ID/notes/1a2b3c4d" \
  -H "Authorization: Bearer $SCRIPTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Lead with the install"}'

Next