Skip to content

Add Document Comment

Add a comment to the document or draft specified by body.path. Requires authentication, the DOCUMENTS feature flag, and ADMIN, ADD_COMMENT, UPDATE_DOCUMENT, or MANAGE_DOCUMENTS permissions.

Parameters

name * are required parametersdata typedescription
documentId*stringThe unique identifier of the document.
body.comment*objectEditor JSON object containing the comment content, not a plain text string.
body.path*stringFull Firestore path of the document or draft that owns the comments. Do not include /comments/:commentId or an /api prefix.

body.path selects the record whose comment collection and embedded comment metadata are updated. For a site draft, use sites/:siteId/S_:siteId/:siteId/documents/:documentId/versions/draft, replacing every placeholder with its actual ID. This Firestore path is distinct from the HTTP target path. The service generates the comment ID and creation metadata; the response does not return the comment.

Return Value

HTTP 201 Created. The JSON body is:

json
{
  "message": "Successfully added the comment",
  "data": null
}

Examples

bash
curl -X PUT "https://app.wombat.software/api/{targetPath}/document/:documentId/comment" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ..." \
  -d '{
  "comment": {
    "doc": {
      "type": "doc",
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "Please review section 3."
            }
          ]
        }
      ]
    },
    "selection": {
      "type": "text",
      "anchor": 1,
      "head": 1
    },
    "plugins": []
  }
}'

ENDPOINTS

put/api/{targetPath}/document/:documentId/comment