Docs
API ReferenceReferenceKnowledgebases

Edit a page in place

PATCH
/knowledgebases/{knowledgebaseId}/pages/{pageId}

Applies anchored operations against the page's current markdown: replace, insert_before, insert_after, prepend, append, replace_range. Anchors (oldString, anchor, from, to) must appear exactly once in the current text, or the whole patch is refused and nothing changes. Ops apply in order, each against the result of the previous. Quote the exact text you read, including whitespace; widen an anchor with surrounding words when it is ambiguous. Up to 50 ops per request. Read the page with GET first and quote its text. When the organization reviews agent writes, the response is 202 with status: "pending_review" and the live page is untouched until approved. Requires the knowledge:write scope; a personal key also needs the member role or above.

AuthorizationBearer <token>

An organization API key, created from a Portal's Webhooks page (Provisioning API card). The secret is shown once at creation and stored only as a hash. Keys are organization-wide and carry scopes (end_users:read, end_users:write). Rate limit: 120 requests per minute per key (sliding 60-second window).

In: header

Path Parameters

knowledgebaseId*string
Formatuuid
pageId*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/knowledgebases/497f6eca-6276-4993-bfeb-53cbbbba6f08/pages/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "patch": [      {        "op": "replace",        "oldString": "string",        "newString": "string"      }    ]  }'
{  "status": "applied",  "page": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "knowledgebaseId": "2eaa043e-18a5-42f0-bbe8-1ad77d6f870c",    "title": "string",    "updatedAt": "2019-08-24T14:15:22Z"  },  "revisionId": "bae12d01-48af-47b3-9304-b09ef0081cd6",  "reviewPath": "string",  "links": {    "pages": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "title": "string"      }    ],    "sources": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "name": "string"      }    ],    "unresolved": [      {        "kind": "page",        "id": "string"      }    ]  }}