Skip to main content
POST
/
public
/
v1
/
docs
/
{docId}
/
md
Update Document Content
curl --request POST \
  --url https://api.copera.ai/public/v1/docs/{docId}/md \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "operation": "replace",
  "content": "<string>"
}
'
{
  "success": true,
  "message": "<string>"
}

Overview

Updates the Markdown content of a document. Three operations are supported:
  • Replace — overwrites the entire document body with the provided content.
  • Append — adds the provided content to the end of the existing body.
  • Prepend — adds the provided content to the beginning of the existing body.

Asynchronous Processing

Content updates are queued and processed asynchronously. The API returns an HTTP 202 Accepted response to indicate the update has been accepted and will be applied shortly.

Request Body

  • content (required): The Markdown content to apply.
  • operation (required): One of replace, append, or prepend.

Response

Returns HTTP 202 Accepted with a confirmation that the update has been queued.

Authorizations

Authorization
string
header
required

Bearer token

Path Parameters

docId
string
required

ObjectId

Required string length: 24
Pattern: ^[0-9a-fA-F]{24}$

Body

application/json
operation
required

Content operation type

Available options:
replace
content
string
required

Markdown content

Response

Default Response

success
boolean
required
message
string
required