> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Comment by Foreign ID

> Get a comment by its foreign ID

Returns a single comment matching the given `foreignId` within the project. Useful for looking up comments using your own application's identifiers.

> [!NOTE]
>
> If the comment author is block-edged with the signed-in caller, in either
> direction, this returns `404` with `comment/not-found` — identical to a
> comment that does not exist. An embedded `parentComment` is nulled under the
> same rule. Requires the `moderation` bundle.

## Query Parameters

**foreignId** `string` *required*

The foreign ID to look up.

**include** `string`

Comma-separated list of associations to include. Valid values: `user`, `entity`, `space`, `parent`, `grants` (the [reputation-grant summary](https://docs.sublay.io/v7/data-models/reputation-grant.md#grantsummary)).

## Response

Returns a `200 OK` with the following shape:

```json theme={null}
{
  "comment": { ...Comment }
}
```

The `comment` field is a [Comment](https://docs.sublay.io/v7/data-models/comment.md) object. If the comment has been removed (user-deleted or moderation-removed) and the viewer is not the author, identifying fields (`userId`, `user`, `content`, `gif`, `mentions`, `attachments`) are nulled out as a Reddit-style placeholder.

> [!NOTE]
>
> This endpoint **nests the record under a `comment` key**, unlike every other read surface, which returns the record bare. So a requested grants summary lives at `comment.grants` — see [GrantSummary](https://docs.sublay.io/v7/data-models/reputation-grant.md#grantsummary).

## Error Responses

> [accordion] Not Found — 404
>
> ```json theme={null}
> { "error": "Comment not found", "code": "comment/not-found" }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.