Skip to content

Apply Exact Content Edits

POST
/pages/{pageId}/edits
curl --request POST \
--url https://markdawn.space/api/v1/pages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "edits": [ { "id": "rename-heading", "oldText": "# Draft", "newText": "# Notes" } ] }'

Replaces one or more exact passages without replacing the full page. Each old passage must occur exactly once, and missing or overlapping matches are rejected. Use Idempotency-Key when retrying the same request.

pageId
required
string format: uuid

The UUID of the page.

Idempotency-Key
string
>= 1 characters <= 200 characters /\S/

Use the same key to retry the same request. Completed responses are replayed for 24 hours; incomplete reservations expire after 5 minutes.

Media typeapplication/json
object
edits
required
Array<object>
>= 1 items <= 100 items
object
id
required
string
oldText
required
string
newText
required
string
Example
{
"edits": [
{
"id": "rename-heading",
"oldText": "# Draft",
"newText": "# Notes"
}
]
}

One result for each requested edit and the new ETag.

Media typeapplication/json
object
results
required
Array
One of:
object
id
required
string
>= 1 characters
status
required
string
Allowed value: applied
etag
required
string
>= 1 characters
Example
{
"results": [
{
"status": "applied"
}
]
}
ETag
string

Revision identifier for the returned page content.

The API token is missing a required scope: pages:write.

Media typeapplication/json

Structured error returned when the request cannot be completed.

object
error
required

Error details for programmatic handling.

object
code
required

Stable error code.

string
message
required

Human-readable explanation.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}