Kanorio

API リファレンス

Revisions

Management API: GET /sites/{id}/revisions, GET /sites/{id}/revisions/{revisionId}, POST /sites/{id}/revisions/{revisionId}/restore

このページは英語のみです。API リファレンス、Webhook イベント、変更履歴は、コード内のフィールド名やエラーコードと揃えるため英語で提供しています。
Base URL https://app.kanorio.com/api/v1ErrorsPagination

List revisions

GET/sites/{id}/revisions
betaeditor:enterdefault (120/minute per token)

List content revisions for a website draft (subject: WEBSITE, subjectId omitted or equal to websiteId), a blog post (subject: BLOG_POST, subjectId: postId), or a custom collection item (subject: CONTENT_ITEM, subjectId: itemId). Revisions are retained for 30 days and coalesced within 10-minute autosave windows. Optionally pass pageId when listing WEBSITE revisions to filter to edits that touched that page. Newest first. Errors: FORBIDDEN, INVALID_CURSOR.

Parameters

  • idstring · pathrequired

    Website id. Get it from sites.list or from sites.create.

  • subject"WEBSITE" | "BLOG_POST" | "CONTENT_ITEM" · query

    Defaults to WEBSITE.

  • subjectIdstring · query

    Required unless subject is WEBSITE (pass postId for BLOG_POST, itemId for CONTENT_ITEM); defaults to websiteId for WEBSITE.

  • pageIdstring · query

    Optional filter for WEBSITE revisions: only revisions that modified this page or whole-site checkpoints.

  • limitinteger · query

    Maximum number of items to return, 1–100. Defaults to 20.

  • cursorstring · query

    Opaque cursor from the previous page's nextCursor. Omit for the first page.

Response 200

  • dataobject[]required
  • data[].idstringrequired
  • data[].websiteIdstringrequired
  • data[].subject"WEBSITE" | "BLOG_POST" | "CONTENT_ITEM"required

    Subject type: WEBSITE for site-wide draft and page sections, BLOG_POST for a blog article, CONTENT_ITEM for a custom collection item.

  • data[].subjectIdstringrequired
  • data[].kind"AUTO" | "PUBLISH" | "PRE_RESTORE" | "PRE_AI" | "MANUAL"required

    Why the revision was recorded.

  • data[].schemaVersionintegerrequired
  • data[].contentHashstringrequired
  • data[].summaryobject | nullrequired
  • data[].summary.titlestring
  • data[].summary.editedPageIdsstring[]
  • data[].summary.editedPageTitlesobject
  • data[].summary.editedScopes"sections" | "header" | "footer" | "siteSettings" | "theme" | "pages"[]
  • data[].summary.collectionKeystring

    CONTENT_ITEM only: the collection this item belongs to.

  • data[].summary.status"draft" | "published" | "changed"

    CONTENT_ITEM only.

  • data[].summary.backup"beforeDelete"

    Set when the system recorded this revision automatically (e.g. right before the item was moved to the trash).

  • data[].labelstring | nullrequired
  • data[].actorobjectrequired
  • data[].actor.idstring | nullrequired
  • data[].actor.namestring | nullrequired
  • data[].actor.emailstring | nullrequired
  • data[].actor.imagestring | nullrequired
  • data[].actor.isAgentbooleanrequired

    True when the revision was written through an API token or MCP client.

  • data[].actor.tokenNamestring | null
  • data[].createdAtstringrequired
  • data[].updatedAtstringrequired
  • hasMorebooleanrequired

    True when another page exists; pass nextCursor to fetch it.

  • nextCursorstring | nullrequired

    Cursor for the next page, or null on the last page.

Errors

  • FORBIDDEN 403
  • INVALID_CURSOR 400

MCP tool revisions_list

curl -X GET "https://app.kanorio.com/api/v1/sites/{id}/revisions?subject=WEBSITE&limit=20" \
  -H "Authorization: Bearer $KANORIO_TOKEN"
Response
{
  "data": [
    {
      "id": "rev_example01",
      "websiteId": "ws_example123",
      "subject": "WEBSITE",
      "subjectId": "ws_example123",
      "kind": "AUTO",
      "schemaVersion": 1,
      "contentHash": "a1b2c3d4:1240",
      "summary": {
        "editedPageIds": [
          "pg_example456"
        ],
        "editedPageTitles": {
          "pg_example456": "Home"
        },
        "editedScopes": [
          "sections"
        ]
      },
      "label": null,
      "actor": {
        "id": "usr_example01",
        "name": "Sunny Lin",
        "email": "sunny@example.com",
        "image": null,
        "isAgent": true,
        "tokenName": "Cursor MCP"
      },
      "createdAt": "2026-10-01T02:30:00.000Z",
      "updatedAt": "2026-10-06T08:00:00.000Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}

Retrieve a revision

GET/sites/{id}/revisions/{revisionId}
betaeditor:enterdefault (120/minute per token)

Get the full unpacked snapshot of a content revision by revisionId. Media references belonging to this site's library are presented as asset:<assetId> with display metadata in assets. Errors: FORBIDDEN, REVISION_NOT_FOUND.

Parameters

  • idstring · pathrequired

    Website id. Get it from sites.list or from sites.create.

  • revisionIdstring · pathrequired

    Revision identifier from revisions.list.

Response 200

  • revisionobjectrequired
  • revision.idstringrequired
  • revision.websiteIdstringrequired
  • revision.subject"WEBSITE" | "BLOG_POST" | "CONTENT_ITEM"required

    Subject type: WEBSITE for site-wide draft and page sections, BLOG_POST for a blog article, CONTENT_ITEM for a custom collection item.

  • revision.subjectIdstringrequired
  • revision.kind"AUTO" | "PUBLISH" | "PRE_RESTORE" | "PRE_AI" | "MANUAL"required

    Why the revision was recorded.

  • revision.schemaVersionintegerrequired
  • revision.contentHashstringrequired
  • revision.summaryobject | nullrequired
  • revision.summary.titlestring
  • revision.summary.editedPageIdsstring[]
  • revision.summary.editedPageTitlesobject
  • revision.summary.editedScopes"sections" | "header" | "footer" | "siteSettings" | "theme" | "pages"[]
  • revision.summary.collectionKeystring

    CONTENT_ITEM only: the collection this item belongs to.

  • revision.summary.status"draft" | "published" | "changed"

    CONTENT_ITEM only.

  • revision.summary.backup"beforeDelete"

    Set when the system recorded this revision automatically (e.g. right before the item was moved to the trash).

  • revision.labelstring | nullrequired
  • revision.actorobjectrequired
  • revision.actor.idstring | nullrequired
  • revision.actor.namestring | nullrequired
  • revision.actor.emailstring | nullrequired
  • revision.actor.imagestring | nullrequired
  • revision.actor.isAgentbooleanrequired

    True when the revision was written through an API token or MCP client.

  • revision.actor.tokenNamestring | null
  • revision.createdAtstringrequired
  • revision.updatedAtstringrequired
  • snapshotobjectrequired
  • assetsobjectrequired

Errors

  • FORBIDDEN 403
  • REVISION_NOT_FOUND 404

MCP tool revisions_get

curl -X GET "https://app.kanorio.com/api/v1/sites/{id}/revisions/{revisionId}" \
  -H "Authorization: Bearer $KANORIO_TOKEN"
Response
{
  "revision": {
    "id": "rev_example01",
    "websiteId": "ws_example123",
    "subject": "WEBSITE",
    "subjectId": "ws_example123",
    "kind": "AUTO",
    "schemaVersion": 1,
    "contentHash": "a1b2c3d4:1240",
    "summary": {
      "editedPageIds": [
        "pg_example456"
      ],
      "editedPageTitles": {
        "pg_example456": "Home"
      },
      "editedScopes": [
        "sections"
      ]
    },
    "label": null,
    "actor": {
      "id": "usr_example01",
      "name": "Sunny Lin",
      "email": "sunny@example.com",
      "image": null,
      "isAgent": true,
      "tokenName": "Cursor MCP"
    },
    "createdAt": "2026-10-01T02:30:00.000Z",
    "updatedAt": "2026-10-06T08:00:00.000Z"
  },
  "snapshot": {
    "siteSettings": {},
    "globalSections": [],
    "themeSettings": {
      "sectionDensity": "standard"
    },
    "pages": [
      {
        "id": "pg_example456",
        "slug": "/",
        "title": "Home",
        "isHomePage": true,
        "sections": []
      }
    ]
  },
  "assets": {}
}

Restore a revision

POST/sites/{id}/revisions/{revisionId}/restore
betacontent:editdefault (120/minute per token)

Restore a website draft, blog post working copy, or custom collection item to a previous revision. Before writing, the current draft is automatically backed up as a PRE_RESTORE revision so the restore itself can be undone. Restoring writes only to the draft/working copy and never alters the live published site directly; call site.publish, posts.publish or items.publish to publish. For WEBSITE revisions, pass mode: "page" with pageId to restore only a single page's sections, or mode: "full" (default) to restore the entire site draft and theme settings. A CONTENT_ITEM that is in the trash cannot be restored to a revision (SUBJECT_NOT_FOUND): call items.restore first. Errors: FORBIDDEN, REVISION_NOT_FOUND, SUBJECT_NOT_FOUND, PAGE_NOT_FOUND_IN_REVISION, PAGE_NOT_FOUND_IN_SITE, VALIDATION_FAILED, WRITE_FROZEN.

Parameters

  • idstring · pathrequired

    Website id. Get it from sites.list or from sites.create.

  • revisionIdstring · pathrequired

    Revision identifier from revisions.list.

Request body

  • mode"full" | "page"

    Defaults to "full". Use "page" with pageId to restore only one page of a WEBSITE revision.

  • pageIdstring

    Required when mode is "page".

Response 200

  • restoredtruerequired
  • subject"WEBSITE" | "BLOG_POST" | "CONTENT_ITEM"required

    Subject type: WEBSITE for site-wide draft and page sections, BLOG_POST for a blog article, CONTENT_ITEM for a custom collection item.

  • subjectIdstringrequired
  • revisionIdstringrequired
  • preRestoreRevisionIdstring | nullrequired
  • kind"AUTO" | "PUBLISH" | "PRE_RESTORE" | "PRE_AI" | "MANUAL"required

    Why the revision was recorded.

  • mode"full" | "page"required
  • pageIdstring

    Resolved page id when mode is page.

  • collectionKeystring

    CONTENT_ITEM only: the collection this item belongs to.

Errors

  • FORBIDDEN 403
  • REVISION_NOT_FOUND 404
  • SUBJECT_NOT_FOUND 404
  • PAGE_NOT_FOUND_IN_REVISION 422
  • PAGE_NOT_FOUND_IN_SITE 422
  • VALIDATION_FAILED 422
  • WRITE_FROZEN 503

MCP tool revisions_restore

curl -X POST "https://app.kanorio.com/api/v1/sites/{id}/revisions/{revisionId}/restore" \
  -H "Authorization: Bearer $KANORIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"page","pageId":"pg_example456"}'
Response
{
  "restored": true,
  "subject": "WEBSITE",
  "subjectId": "ws_example123",
  "revisionId": "rev_example01",
  "preRestoreRevisionId": "rev_backup01",
  "kind": "AUTO",
  "mode": "page"
}