> ## Documentation Index
> Fetch the complete documentation index at: https://replyke-feat-push-rich-payload-fields.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Comment by Foreign ID

> Fetch a comment using its external foreign ID

Fetches a single comment using its `foreignId`. Optionally returns the parent comment if it exists and `withParent=true` is passed. This is useful when using a custom identifier set by the client, instead of the internal comment ID.

## Query Parameters

<ParamField query="foreignId" type="string" required>
  The external reference ID used to identify a comment
</ParamField>

<ParamField query="withParent" type="string">
  If `true`, includes the parent comment in the response
</ParamField>

## Response

<ResponseField name="comment" type="object">
  <Expandable title="Comment object">
    <ResponseField name="id" type="string">
      Unique comment identifier
    </ResponseField>

    <ResponseField name="foreignId" type="string">
      External reference ID
    </ResponseField>

    <ResponseField name="content" type="string">
      Comment content
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      Creation timestamp
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="parentComment" type="object">
  Parent comment object (null if no parent or `withParent` not set)
</ResponseField>

## Error Responses

<AccordionGroup>
  <Accordion title="Missing or Invalid Foreign ID - 400 Bad Request">
    ```json theme={null}
    {
      "error": "Missing valid reference ID in request query",
      "code": "comment/invalid-request"
    }
    ```
  </Accordion>

  <Accordion title="Not Found - 404 Not Found">
    ```json theme={null}
    {
      "error": "Comment not found",
      "code": "comment/not-found"
    }
    ```
  </Accordion>

  <Accordion title="Server Error - 500 Internal Server Error">
    ```json theme={null}
    {
      "error": "Internal server error.",
      "code": "comment/server-error",
      "details": "[error message]"
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Notes

* Requires a valid `foreignId` to locate the comment.
* Set `withParent=true` to include the parent comment.
* Returns `parentComment: null` if there is no parent or it's not requested.
