Skip to main content
Fetch Comment by Foreign ID
Returns a single comment matching the given foreignId within the project. Useful for looking up comments using your own application’s identifiers.

Query Parameters

string
Service key only: the user to read as. The response is exactly what that user’s own access token would get: the blocks below apply to them, a moderator-removed comment of theirs is shown in full, and moderation details (moderationReason, moderatedById, moderatedByType) appear only where that user may see them. Leave it out for the anonymous view, with no moderation details. 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).
string
required
The foreign ID to look up.
string
Associations to include, as a comma-separated value (include=user,parent) or repeated params. Values: user, entity, space, parent, grants (the reputation-grant summary). Matching ignores case; an unknown value returns 400 comment/invalid-query. With entity or space, entity is null when the entity isn’t available to the caller (for example, removed by a moderator) — the comment is still returned, and there is no space. The included entity is the entity’s stored record, without the fields an entity fetch computes or joins (such as commentsCount, userReaction and nsfwEffective) — see The included entity. With parent, parentComment is null when the parent no longer exists or is on another entity.

Space-scoped reputation

This endpoint has a space in context, so it accepts the opt-in reputation params. They add a spaceReputation field to the populated author user (with include=user), alongside the always-present reputation total. Requires the reputation bundle. See the Reputation data model for the full contract.

Response

Returns a Comment object, with isAuthorBlocked and isUnavailable flags. A deleted comment, or a moderator-removed one viewed by anyone but its author, is returned as a placeholder — the author and content are blanked, and the comment’s id, parentId, timestamps and counts are kept.

Blocks

When the caller is signed in and the moderation bundle is installed, the comment comes back the same way a thread shows it:
  • The caller blocked the author — the full comment, with isAuthorBlocked: true.
  • The author blocked the caller (or both blocked each other) — a placeholder with isUnavailable: true.
  • The entity’s author blocked the caller — 404 comment/not-found, identical to a comment that doesn’t exist. This applies to every comment on that entity, except the caller’s own.
An embedded parentComment follows the same placeholder and flag rules. Your own comment on an unavailable entity: when the entity’s author has blocked the caller, the caller can still open their own comments there, so they can find and delete them. entity (which carries space) and parentComment are null on those comments when requested. They 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, and doesn’t say why.

Error Responses

Returned when foreignId is missing or empty, when include contains an unknown value, or when spaceReputationId or spaceReputationDescendants is malformed.
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.