> ## 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.

# Delete Comment

> Delete a comment

Deletes a comment. Only the comment's author, or a request with a service or master key, can delete a comment.

**Authentication required.**

All deletes are soft-deletes: the comment's content, gif, mentions, and attachments are cleared and `userDeletedAt` is set. The record is preserved as a stripped placeholder in thread view to maintain the reply tree structure (Reddit-style).

## Path Parameters

<ParamField path="commentId" type="string" required>
  The UUID of the comment to delete.
</ParamField>

## Blocks

A comment on an entity whose author has blocked the caller is hidden from them, so when the caller isn't the comment's author, the delete is refused with `404 comment/not-found` — the same response as a missing comment. This check runs before the others, so such a caller gets `comment/not-found` rather than `comment/already-deleted` or a `403`. A comment's author can always delete their own comment, and requests made with a service or master key aren't subject to this check. It applies only when the `moderation` bundle is installed.

## Response

Returns `204 No Content` on success.

## Error Responses

<AccordionGroup>
  <Accordion title="Invalid Params — 400">
    Returned when `commentId` isn't a valid UUID.

    ```json theme={null}
    { "error": "commentId: Invalid UUID format", "code": "comment/invalid-params" }
    ```
  </Accordion>

  <Accordion title="Not Found — 404">
    Returned when the comment doesn't exist, or when the caller isn't the comment's author and the author of the comment's entity has blocked them (see [Blocks](#blocks)).

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

  <Accordion title="Already Deleted — 404">
    ```json theme={null}
    { "error": "Comment already deleted", "code": "comment/already-deleted" }
    ```
  </Accordion>

  <Accordion title="Forbidden — 403">
    Returned when the caller isn't the comment's author and isn't using a service or master key.

    ```json theme={null}
    { "error": "You do not have permission to delete this comment.", "code": "comment/not-authorized" }
    ```
  </Accordion>
</AccordionGroup>


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