Skip to main content
Create Comment
Creates a new comment on an entity, or a reply to an existing comment. The comment is attributed to the authenticated user. Notifications are sent to the entity owner (for a top-level comment), the parent comment’s author (for a reply), and mentioned users. Authentication required. A comment can carry images and files, uploaded with it as multipart/form-data (see File Uploads below); without them, use application/json. A comment’s files are set when it is created: editing a comment changes its text only, and deleting it deletes its files.

Body Parameters

string
required
The UUID of the entity this comment belongs to.
string | null
The text content of the comment. At least one of content, gif, attachments, images or files must be provided. null or an empty string stores none.
object
A GIF to attach to the comment. At least one of content, gif, attachments, images or files must be provided.
aspectRatio is width ÷ height as a decimal string. Colon notation like "16:9" is rejected by clients that compute layout from it.
object[]
An array of generic attachment objects. At least one of content, gif, attachments, images or files must be provided.
string | null
The UUID of the parent comment. When provided, this comment is treated as a reply to that comment. For a top-level comment, send null or leave it out; the string "none" is refused with 400 comment/unsupported-param (see Saying “no value”). The parent comment must be on the entity given in entityId — otherwise the request returns 404 comment/entity-not-found. The parent comment’s author receives a reply notification.The parent comment can’t be a deleted one (deleted by its author, or its author’s account was deleted: 403 comment/parent-deleted) or one a moderator removed (403 comment/parent-removed) — see Deleted and removed parents and quotes.
string
The UUID of a comment being quoted or referenced. Used for quote-replies. The quoted comment may be on any entity, but it must be visible to the commenting user — otherwise the request returns 404 comment/entity-not-found.The quoted comment can’t be a deleted one (deleted by its author, or its author’s account was deleted: 403 comment/referenced-deleted) or one a moderator removed (403 comment/referenced-removed) — see Deleted and removed parents and quotes.
string
Your application’s identifier for this comment. Must be unique across the project’s comments — a foreignId already in use returns 409 comment/foreign-id-taken. A foreignId stays reserved after its comment is deleted: the deleted comment remains in its thread as a placeholder and is still found by that foreignId.
object[]
Users or spaces mentioned in the comment. Each mentioned user receives one in-app notification, however many times they are mentioned, except the person the comment already notifies: the entity owner for a top-level comment, or the parent comment’s author for a reply. A space mention sends no notification, and a commenter mentioning themselves is not notified.
  • { type: "user", id: string, username: string, foreignId?: string }
  • { type: "space", id: string, slug: string }
object
A free-form JSON object for any custom data your application needs alongside the comment. Up to 10 KB (10,240 bytes) as JSON — a larger object returns 400 comment/invalid-body.
string
Service key only, and required with one: the user this request acts as, who authors the comment. A key has no user of its own, so leaving it out returns 400 comment/missing-user-id. Useful for backfilling comments from external systems. A user token always acts as its own user and must not send it (400 comment/acting-user-not-allowed).An actingUserId that doesn’t match a user returns 404 comment/user-not-found.
string
Datetime to backfill a creation timestamp. Service key only — with a user token the value is ignored and the comment gets the current time.Must be a UTC ISO 8601 datetime ending in Z, such as 2026-01-15T09:30:00Z. A value with an offset (+02:00) or a date without a time returns 400 comment/invalid-body (createdAt: Invalid ISO datetime), whichever credential sends it.It can’t be more than five minutes in the future: a later date returns 400 comment/invalid-body (createdAt can't be in the future.).
string
Datetime for updatedAt, in the same format as createdAt — UTC ISO 8601 ending in Z; anything else returns 400 comment/invalid-body. Service key only — with a user token the value is ignored.Requires createdAt, and must be the same as or later than it; otherwise the request returns 400 comment/invalid-timestamp. When only createdAt is sent, updatedAt is set to the same time. More than five minutes in the future returns 400 comment/invalid-body (updatedAt can't be in the future.).

File Uploads (multipart/form-data)

Send the comment as multipart/form-data to upload files with it. Every field is then a string: send gif, mentions, attachments and metadata as JSON strings. A comment with only images or files (no text) is valid. Uploads require the files-images bundle.
file[]
Images, up to 50 MB each, processed into sizes per images.options. Requires images.options. A request takes at most 20 files over images and files together (see Upload errors).
string
JSON-stringified image-processing options applied to every image (mode is required), the same options as Create Entity’s. A key the options don’t take, a key of another mode included (for example sizes with exact-dimensions), is refused with 400 comment/invalid-body, param naming it.
file[]
Files stored as uploaded, up to 50 MB each. Each file’s type comes from its MIME type; an image sent here isn’t processed, so it has no image data.
string
Optional JSON-stringified file options: pathParts (string[]) customizes the storage path. A key other than pathParts is refused with 400 comment/invalid-body, param naming it.
The comment’s files list the images first, then the files, each in upload order. An images.options or files.options sent without its files isn’t used, but is still validated: invalid options get a 400.

Blocks

When the moderation bundle is installed, three people are checked: the entity’s author, the parent comment’s author (for replies), and the quoted comment’s author (with referencedCommentId).
  • If the commenting user blocked any of them, the comment is allowed — the block is their own choice. The blocked person isn’t notified.
  • If any of them blocked the commenting user (or both blocked each other), the request is refused with 404 comment/entity-not-found — the same response as a missing entity, so it never reveals a block.
A comment marked isUnavailable can’t be replied to. Commenting can also be refused when the entity’s author has blocked the commenting user, which no comment flag shows.

Spaces

Commenting and replying take part in the entity’s space (see Who can post and take part). The commenting user must be able to read the space’s content — otherwise the request returns 404 comment/entity-not-found, the same as a missing entity — 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: a space whose posting is "team" still takes comments from everyone who reads it.

Deleted and removed parents and quotes

A comment its author deleted, or a moderator removed, can’t be replied to or quoted: This applies to everyone, including the author of a removed comment, who still sees it in full. A comment that is both deleted and removed returns the deleted code. When the parent and the quoted comment are both refused, the response is the parent’s. For replies, the rule covers the direct parent only. Replies that already sit under a deleted or removed comment can still be replied to, and quoted. These responses are only returned for a comment the commenting user can see. A deleted or removed comment that a block hides from them (see Blocks) returns 404 comment/entity-not-found, like any other.

Response

Returns 201 Created with the new Comment object, populated with the author’s user profile. When the files-images bundle is installed it also carries files: the comment’s files, images with their variants ([] for none), so you can show an upload without fetching the comment again.

Error Responses

Returned when the entity doesn’t exist, when it’s in a space the commenting user can’t read (see Spaces), when parentCommentId doesn’t exist or belongs to another entity, when the quoted comment isn’t visible to the commenting user, or when a block refuses the comment (see Blocks).
The commenting user can read the entity but is banned in its space or in a space above it. Nothing is written.
Returned when a service key sends no actingUserId.
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 the body fails validation. error names the field and the problem:
  • none of content, gif, attachments, images or files is provided — content that is empty or only whitespace, and an empty attachments array, don’t count;
  • entityId, parentCommentId, referencedCommentId or actingUserId isn’t a UUID (a missing entityId included);
  • gif is missing one of its six fields, or one has the wrong type;
  • a mentions item doesn’t match one of the two shapes;
  • foreignId is an empty string or longer than 255 characters;
  • metadata isn’t an object, or is larger than 10 KB;
  • createdAt or updatedAt isn’t a UTC ISO 8601 datetime ending in Z;
  • from a service key, createdAt or updatedAt is more than five minutes in the future (createdAt can't be in the future. / updatedAt can't be in the future., with param naming the field).
Returned when a user token sends 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 the request sends parentId. A reply’s parent comment is parentCommentId.
Also returned when the request sends userId. On this route the user a service key acts as is actingUserId.With a service key:
With a user token, or with no credentials:
Returned when a service key names an actingUserId that isn’t a user in this project.
Returned to a service key when updatedAt is sent without createdAt, or is earlier than it.
Returned when your project’s comment.created validation webhook doesn’t approve the comment. Nothing is created. error is the message your webhook responded with, when it sent one.
Returned when parentCommentId is a comment its author deleted (see Deleted and removed parents and quotes).
Returned when parentCommentId is a comment a moderator removed — for every requester, including that comment’s author (see Deleted and removed parents and quotes).
Returned when referencedCommentId is a comment its author deleted (see Deleted and removed parents and quotes).
Returned when referencedCommentId is a comment a moderator removed — for every requester, including that comment’s author (see Deleted and removed parents and quotes).
Returned when images or files are uploaded on a project without the files-images bundle. missingTables lists the tables that aren’t installed and bundleId the bundle to install. While the bundle is still being installed, the response is 503 database/tables-provisioning instead. See Bundles.
A file is over 50 MB. param names its field (images or files).
A file in images can’t be read as an image. error names the file as it was uploaded. An image over 10000 px on a side gets the same code. error gives its size:
images was sent without images.options. Checked before the validation webhook and before anything is uploaded, so nothing is stored.
images.options without mode, or with a mode that isn’t one of the five (other options fields the same way, named in error and param):
In an aspect-ratio mode, a variant’s computed side would be outside 1–10000 px. Checked once the image is read, before anything is stored. param names the option:
In aspect-ratio-height-based it names a heights option and gives a width. In multi-aspect-ratio it names a sizes option, and the ratio is the one in aspectRatios closest to the image, so the text reads ”… at the 3:1 aspect ratio, the one in aspectRatios closest to this image. Each side of a variant must be 1–10000 px.” More than 30 entries in dimensions, widths, heights or sizes (one variant each). param names the option:
A variant name that uses a character other than letters, digits, _, - and ., that is longer than 64 characters, that contains .., or that is original. param names the option:
A key the options don’t take (also a key of another mode). error names the object holding it, param the key itself:
files.options takes only pathParts; any other key gets the same code:
The uploaded files would take the project past its plan’s file-storage limit. Nothing is created or stored.
A file was refused as the body was read: comment/unsupported-file-type or comment/unexpected-file-field (a file in a field other than images and files), with param naming the field when there is one, or 413 comment/too-many-files for more than 20 files in the request. A body over 250 MB gets 413 request/body-too-large; one that can’t be read at all gets request/invalid-multipart or request/field-too-large. See Upload errors.
Returned when another comment already uses the supplied foreignId.