Append Or Prepend Content
POST
/pages/{pageId}/content-operations
const url = 'https://markdawn.space/api/v1/pages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/content-operations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":"append-summary","operation":"append","content":"\n\n## Summary\n"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”pageId
required
string format: uuid
The UUID of the page.
Header Parameters
Section titled “Header Parameters”Idempotency-Key
string
Use the same key to retry the same request. Completed responses are replayed for 24 hours; incomplete reservations expire after 5 minutes.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
id
required
string
operation
required
string
content
required
string
Example
{ "id": "append-summary", "operation": "append", "content": "\n\n## Summary\n"}Responses
Section titled “Responses”Content was added and the new ETag is returned.
Media typeapplication/json
object
id
required
string
etag
required
string
Examplegenerated
{ "id": "example", "etag": "example"}Headers
Section titled “Headers”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" }}