Skip to content

Edit Document Comment

Replace the editor content of an existing comment. Requires authentication, the DOCUMENTS feature flag, and ADMIN, EDIT_COMMENT, UPDATE_DOCUMENT, or MANAGE_DOCUMENTS permissions.

Parameters

name * are required parametersdata typedescription
documentId*stringThe unique identifier of the document.
commentId*stringThe unique identifier of the comment.
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.updatedAtnumberLast known comment update timestamp in milliseconds. Omit only when the comment has no stored updatedAt value (typically the first edit).

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 requires updatedAt to exactly match the stored comment timestamp. A missing or stale value after an earlier edit returns HTTP 400. Replace the example timestamp with the current comment timestamp, or omit it for an unedited comment.

Return Value

HTTP 201 Created. The JSON body is:

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

Examples

bash
curl -X POST "https://app.wombat.software/api/{targetPath}/document/:documentId/comment/:commentId" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ..." \
  -d '{
  "comment": {
    "doc": {
      "type": "doc",
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "Updated feedback."
            }
          ]
        }
      ]
    },
    "selection": {
      "type": "text",
      "anchor": 1,
      "head": 1
    },
    "plugins": []
  },
  "updatedAt": 1789380000000
}'

ENDPOINTS

post/api/{targetPath}/document/:documentId/comment/:commentId