Skip to main content
A comment represents a user-authored response to an entity. Comments support nested replies, reactions, GIF attachments, user mentions, and moderation.

Properties

Nested Types

GifData

All six fields are required when a GIF is attached.

Includes

Pass include to populate optional fields. What each endpoint accepts: On a thread fetch, include applies at every nested level.

The included entity

entity is the entity’s stored record. It carries every stored Entity field — id, shortId, foreignId, sourceId, spaceId, userId, title, content, mentions, attachments, keywords, upvotes, downvotes, reactionCounts, sharesCount, views, score, scoreUpdatedAt, location, metadata, nsfw, the moderation fields, isDraft, createdAt, updatedAt and deletedAt. The fields an entity fetch computes or joins are not included: entity.space is present only when include contains "space", and is null when the entity isn’t in a space. It is the Space record with membersCount and childSpacesCount (and isMember for a signed-in caller), without the avatarFile and bannerFile objects.

Placeholders

A comment that can’t be shown in full stays in place as a placeholder, so the replies under it — other people’s conversation — aren’t lost. There are three kinds, and each keeps a marker so your app can tell them apart: On a placeholder, userId, user, content, gif and metadata are null, and mentions and attachments are []. Everything else is kept: id, entityId, parentId, foreignId, timestamps, reactionCounts, repliesCount and the markers. Markers can combine — for example, a deleted comment whose author blocked the requesting user carries both userDeletedAt and isUnavailable: true. Render isUnavailable first: show the neutral unavailable row, without reply or reaction controls. Nothing is written into content; render your own wording for each kind. A deleted or removed comment can’t take new direct replies, new reactions or quotes — including a removed comment its author sees in full — so hide the reply, reaction and quote controls on it. The replies already under it can still be replied to, and a reaction already on it can still be removed. See Deleted and removed parents and quotes and Add Comment Reaction. A placeholder’s moderation fields follow Moderation fields: moderationStatus is always kept, and moderationReason, moderatedById and moderatedByType are filled only for the requesters listed there.

Moderation fields

moderationStatus is returned to everyone. The other three moderation fields are returned only to some requesters, on every comment response; everyone else gets null: A comment on an entity with no space has no space moderators: only project-role admins and moderators, keys and the comment’s author qualify.

Blocked authors

When the requesting user is signed in and the moderation bundle is installed, comments returned by thread, user-history, single-comment, topComments, update-comment and add/remove-reaction responses carry two flags (both false by default):
  • isAuthorBlocked reflects only the requesting user’s own preference. Your app decides how to render it — collapse it, offer “show anyway”, or hide it. The user can still reply to and react to it.
  • isUnavailable is neutral: the comment exists, but can’t be shown to this user, and the reason isn’t disclosed. Replying to or reacting to it is refused, so hide those controls.
The other responses that return a comment — create comment and search — don’t include these flags.

What repliesCount counts

repliesCount is the number of a comment’s direct replies, and it counts everything the thread contains: deleted, removed and unavailable replies included, since they stay in the thread as placeholders. It’s the same number for every user, and it matches what paging through the comment’s replies returns. Use it for display (“12 replies”), and use pagination.hasMore to decide whether to show a “load more” button. An entity’s commentsCount counts its comments at every depth by the same rule.

See Also