Skip to content

Append Or Prepend Content

POST
/pages/{pageId}/content-operations
curl --request POST \
--url https://markdawn.space/api/v1/pages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/content-operations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "id": "append-summary", "operation": "append", "content": "\n\n## Summary\n" }'

Adds markdown at the beginning or end of the current page content. The operation runs against the latest content and returns the new ETag. 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
id
required
string
<= 200 characters
operation
required
string
Allowed values: append prepend
content
required
string
>= 1 characters
Example
{
"id": "append-summary",
"operation": "append",
"content": "\n\n## Summary\n"
}

Content was added and the new ETag is returned.

Media typeapplication/json
object
id
required
string
>= 1 characters <= 200 characters
etag
required
string
>= 1 characters
Examplegenerated
{
"id": "example",
"etag": "example"
}
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"
}
}