Skip to main content
Update Comment
Updates a comment’s content, its metadata, or both. Only the comment’s author may update it: with their own access token, or with a service key naming them in actingUserId — the request then runs exactly as theirs, blocks included. A comment with no author belongs to your app: only a service key naming nobody may update it, and a user token gets 403. Authentication required.

Path Parameters

string
required
The UUID of the comment to update.

Body Parameters

content and metadata are individually optional, but at least one must be provided.
string
The new text content for the comment. Leading and trailing whitespace is trimmed. Cannot be empty or only whitespace. Omit to leave the existing content untouched.
object
Arbitrary JSON metadata, up to 10 KB (10,240 bytes) as JSON. Replaces the stored metadata wholesale rather than merging into it.
string
Service key only: the user this edit acts as. Required when the comment has an author: name the author, and the request runs exactly as their own access token’s (naming anyone else gets what their token gets). Leave it out only for an app-owned comment (no author). A user token always acts as its own user and must not send it, and neither may a request with no credentials (400 comment/acting-user-not-allowed).

Deleted and removed comments

A comment its author deleted, and a comment a moderator removed, can’t be edited: the request returns 404 comment/not-found. This includes the author of a moderator-removed comment, who still sees it in full.

Spaces

Editing a comment takes part in its entity’s space (see Who can post and take part). The comment’s author must still be able to read the space’s content — otherwise 404 comment/not-found, for example after leaving a space whose readingPermission is "members", or being banned in one — and must not be banned in the space or any space above it (403 space/posting-not-allowed). The space’s postingPermission isn’t consulted. Deleting the comment stays allowed. Anyone other than the author gets 404 comment/not-found for a comment in a space they can’t read, not a 403. An app-owned comment, edited by a service key naming nobody, is checked as a signed-out caller: on an entity in a members-only or private space it answers 404 comment/not-found.

Blocks

Editing changes content in someone else’s space, so when the moderation bundle is installed, editing is refused with 404 comment/not-found when the author of the comment’s entity, or the author of the comment it replies to, has blocked the comment’s author. Deleting the comment is still allowed. A comment on an entity whose author has blocked the caller is hidden from them, so when the caller isn’t the comment’s author, the edit is refused with 404 comment/not-found — the same response as a missing comment, not a 403. This check also applies only when the moderation bundle is installed. A service key acting as a user is subject to both checks exactly as that user.

Response

Returns the updated Comment object in full, as the caller sees it.

Error Responses

No Authorization header was sent. The body is text/plain (Unauthorized), not JSON. An expired or invalid token returns 403 instead — see Authentication.
Returned when commentId isn’t a valid UUID.
Returned when neither content nor metadata is supplied, when content is an empty string or only whitespace, when metadata isn’t an object, or when metadata is larger than 10 KB.
Returned when your project’s comment.updated validation webhook doesn’t approve the edit. Nothing is changed. error is the message your webhook responded with, when it sent one.
Returned when the comment doesn’t exist, when its author deleted it or a moderator removed it (see Deleted and removed comments), when it’s in a space the caller can’t read (see Spaces), or when a block refuses the edit — including when the caller isn’t the comment’s author and the author of the comment’s entity has blocked them (see Blocks).
Returned when the acting user isn’t the comment’s author, or when a user token, or a service key naming a user, edits a comment with no author.
The comment’s author can read it but is banned in its entity’s space or in a space above it. Nothing is written.
A service key sent no actingUserId for a comment that has an author. Name the author: the request then runs exactly as their own.
A user token, or a request with no credentials, sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
Returned when a service key names an actingUserId that isn’t a user in this project.