Skip to main content
Fetch Comments by User
Requires the comments bundle. A project without the comments bundle returns 403 database/tables-not-available. See Bundles.
Returns a user’s comments as one flat list — top-level comments and replies alike, across every entity — cursor-paginated. Use it for profile pages and activity views. To render a discussion, use Fetch Many Comments instead. Authentication is optional. The history is read as the caller: the signed-in user, or — with a service or master key — the user named in actingUserId. Without one (no user token, or a key without actingUserId) the request is anonymous: deleted and moderator-removed comments are left out, no block rule applies, isAuthorBlocked and isUnavailable are always false, and userReaction isn’t populated. An unknown userId returns an empty page. What’s in the list:
  • Deleted comments are left out.
  • Moderator-removed comments are left out of other people’s history. In the caller’s own history they are included in full, marked moderationStatus: "removed".
  • Blocks: comments by a user the caller is block-edged with are left out by default (see blockedFilter). Comments on an entity whose author has blocked the caller are left out too — except the caller’s own (see Your own comments on an unavailable entity).

Path Parameters

string
required
The Sublay user ID (UUID) of the user whose comments to list.

Query Parameters

Acting user

string
The user to read the history as. Takes effect only with a service or master key. A user token always reads as itself: naming its own ID changes nothing, and naming a different user returns 403 comment/unauthorized. On a request with neither a key nor a user token it is ignored, and the request stays anonymous. With a key, the rules below (own removed comments, blocks, blockedFilter, the isAuthorBlocked / isUnavailable flags and userReaction) apply from that user’s perspective.

Filtering

string
Only comments on this entity.
string
Only comments on entities with this sourceId. Applied whether or not include contains entity. On a project without the entities bundle, a request with sourceId returns an empty page.
string
default:"exclude"
How comments by users the caller is block-edged with are treated. "exclude" (default) leaves them out. "include-outbound-blocked" re-includes comments by users the caller themselves blocked — returned in full and marked isAuthorBlocked: true — and never surfaces content from users who blocked the caller. Has no effect when the moderation bundle is not installed.

Pagination

number
default:"10"
Comments per batch. A whole number of at least 1 — 0, a negative number or a non-integer value returns 400 comment/invalid-query. Values above 100 are treated as 100.
string
Leave it out on the first request (an empty cursor is treated the same way), then pass pagination.nextCursor from the previous response. Must be sent with the same sortBy, sortDir and sortByReaction it was created under. Cursors work as on the thread endpoint — see Cursors.

Sorting

string
default:"createdAt"
createdAt, top (raw count of sortByReaction) or controversial — the same meanings as on Fetch Many Comments. new and old are deprecated aliases for createdAt and receive a Deprecation response header.
string
default:"desc"
asc or desc. Applies to every sort.
string
default:"upvote"
With sortBy=top only: the reaction to rank by (upvote, downvote, like, love, wow, sad, angry, funny). Sending it with any other sortBy returns 400.

Optional associations

string
Comma-separated list of associations to include in each comment:
  • user — the comment author, with the avatar file URLs
  • entity — the entity the comment is on, as its stored record: the fields an entity fetch computes or joins (such as commentsCount, userReaction and nsfwEffective) are not included — see The included entity; null when the entity isn’t available to the caller (for example, removed by a moderator) — the comment is still returned
  • space — the entity’s space, as entity.space (also includes entity); when entity is null there is no space
  • parent — parentComment, for replies; null when the parent no longer exists or is on another entity
  • grants — the reputation-grant summary
include never changes which comments are returned.

Space-scoped reputation

This endpoint accepts the opt-in reputation params, resolved against each comment’s space. They add a spaceReputation field to each populated author user, alongside the always-present reputation total. Requires the reputation bundle. See the Reputation data model.

Response

Comment[]
The user’s comments, in sort order. Each item is a Comment, with isAuthorBlocked and isUnavailable flags. No comment carries nested replies.
string | null
Pass this as cursor to get the next batch. null when there’s nothing more.
boolean
Whether more comments exist after this batch. Exact.
An embedded parentComment follows the same rules as everywhere else: a deleted or removed parent is a placeholder, and a parent whose author blocked the caller is a placeholder with isUnavailable: true.

Your own comments on an unavailable entity

When the caller lists their own history, their comments on an entity whose author has blocked them stay in the list, so they can still find and delete them. On those comments, everything belonging to the entity’s author is blanked: entity (which carries space) and parentComment are null when requested. These comments are read-and-delete only: replying under them, reacting to them, and editing them are refused (404). They aren’t marked by a dedicated field. entity: null only means the entity isn’t available to the caller — it doesn’t say why, so it doesn’t identify these comments.

Error Responses

page isn’t supported — comments use cursor pagination.
Returned with code comment/invalid-params when userId isn’t a valid UUID.
Returned with code comment/invalid-query for invalid values — for example an unknown include value, limit below 1 or not a whole number, or sortByReaction without sortBy=top.
Returned when a request authenticated with a user token sends an actingUserId other than that user’s own ID.

See Also