Search the docs

Search guides, API endpoints and MCP tools.

Planning

edit_document

Write grantIdempotent

Change passages of a ticket's document as its next revision, all or none. Each old passage must appear exactly once in the revision you read; include more of the text around it when it does not. Up to 50 passages. Returns the document. Needs write access.

Inputs

ticketstringRequired

A ticket ID, such as WEB-31.

documentstringRequired

A document's name or slug from get_ticket, such as Plan or build-record.

editsarray of objectsRequired

The passages to change.

At least 1 item
baseRevisionintegerRequired

The revision you read with get_document: 0 for an unwritten document. A change from an older revision is refused; read it again and redo your change.

From 0 to 9,007,199,254,740,991
tools/callJSON-RPC
{  "jsonrpc": "2.0",  "id": 1,  "method": "tools/call",  "params": {    "name": "edit_document",    "arguments": {      "ticket": "WEB-31",      "document": "build-record",      "edits": [        {          "old": "## Decisions\n",          "new": "## Decisions\n- Index at build time, not on request.\n"        }      ],      "baseRevision": 4    }  }}
POST/clanker/v1/tickets:edit-document
curl -X POST https://api.clankership.com/clanker/v1/tickets:edit-document \  -H "Authorization: Bearer $CLANKER_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "ticket": "WEB-31",    "document": "build-record",    "edits": [      {        "old": "## Decisions\n",        "new": "## Decisions\n- Index at build time, not on request.\n"      }    ],    "baseRevision": 4  }'
The same call over the clanker HTTP API. Set CLANKER_TOKEN to a clanker OAuth access token.