Management API

Revisions

Read a document’s history and restore an older version.

Every content write records a revision: the version number, the content, who wrote it and from where (api, mcp or editor), and an optional message. published marks the revisions that went live.

What is kept#

  • A document keeps at most 200 revisions.
  • When there are more, the oldest unpublished revisions are removed first. Published revisions and the one a scheduled document will publish are never removed.
  • Saves in the web editor by the same person within 10 minutes are merged into one revision.

Endpoints#

List revisions#

GET/documents/:id/revisions

Lists the document’s revisions, newest first, without content.

Path parameters
idstringrequired
Query parameters
limitinteger
offsetinteger
Errors
NotFound404
curl "https://api.pmkin.io/documents/6704a1f0c2b3d4e5f6a7b8c9/revisions?limit=10" \
-H "Authorization: Bearer $PMKIN_MANAGEMENT_TOKEN"
Response: 200 OK
[
{
"author": {
"agent": "Claude Code",
"id": "6703f6a7b8c9d0e1f2a3b4c5",
"name": "Writing agent",
"type": "token"
},
"createdAt": "2026-10-08T09:12:44.000Z",
"message": "Add a section on free plans",
"published": false,
"source": "api",
"version": 7
},
{
"author": {
"id": "66f0b2c4d5e6f7a8b9c0d1f0",
"name": "Maja Lind",
"type": "user"
},
"createdAt": "2026-10-07T17:40:02.000Z",
"published": true,
"source": "editor",
"version": 6
}
]

Get a revision#

GET/documents/:id/revisions/:version

Returns one revision with its content.

Path parameters
idstringrequired
versionintegerrequired
Errors
RevisionNotFound404
NotFound404
curl "https://api.pmkin.io/documents/6704a1f0c2b3d4e5f6a7b8c9/revisions/6" \
-H "Authorization: Bearer $PMKIN_MANAGEMENT_TOKEN"
Response: 200 OK
{
"author": {
"id": "66f0b2c4d5e6f7a8b9c0d1f0",
"name": "Maja Lind",
"type": "user"
},
"content": "# Headless CMS pricing\n\nWhat each plan costs, and when an upgrade pays off.\n",
"createdAt": "2026-10-07T17:40:02.000Z",
"published": true,
"source": "editor",
"version": 6
}

Restore a revision#

POST/documents/:id/revisions/:version/restore

Writes the revision’s content as a new version of the draft. Nothing in the history is lost: the restore is a revision too.

Path parameters
idstringrequired
versionintegerrequired
Body
baseVersioninteger
messagestring
Errors
VersionConflict409
RevisionNotFound404
NotFound404
WritesDisabled503
curl -X POST "https://api.pmkin.io/documents/6704a1f0c2b3d4e5f6a7b8c9/revisions/6/restore" \
-H "Authorization: Bearer $PMKIN_MANAGEMENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"baseVersion": 8,
"message": "Back to the version Maja approved"
}'
Response: 200 OK
{
"assigneeId": "66f0b2c4d5e6f7a8b9c0d1f0",
"briefState": "claimed",
"categoryId": "6701c3d4e5f6a7b8c9d0e1f2",
"clusterId": "6702d4e5f6a7b8c9d0e1f2a3",
"contentUpdatedBy": {
"agent": "Claude Code",
"id": "6703f6a7b8c9d0e1f2a3b4c5",
"name": "Writing agent",
"type": "token"
},
"dueDate": "2026-10-20",
"id": "6704a1f0c2b3d4e5f6a7b8c9",
"isPublished": false,
"slug": "headless-cms-pricing",
"status": "drafting",
"title": "Headless CMS pricing",
"updatedAt": "2026-10-08T09:12:44.000Z",
"wordCount": 11,
"hasUnpublishedChanges": false,
"version": 9
}