# Delete comment

> Delete a comment.

Canonical: <https://www.tryadeli.com/docs/api/comments/delete-comment>

`DELETE https://app.tryadeli.com/api/v1/comments/{commentId}`

Authorization: `Bearer <API key>` — see [Authentication](https://www.tryadeli.com/docs/authentication)

**Path parameters**

| Name        | Type     | Required | Description                                                                                                                                                                    |
| ----------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `commentId` | `string` | Yes      | The provider's comment id: a numeric string everywhere but YouTube, whose ids are URL-safe base64. One that does not match the platform's format returns 400 invalid\_request. |

**Query parameters**

| Name        | Type                                                 | Required | Description                                                                                              |
| ----------- | ---------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| `platform`  | `"instagram" \| "facebook" \| "tiktok" \| "youtube"` | Yes      |                                                                                                          |
| `accountId` | `uuid`                                               | Yes      |                                                                                                          |
| `profileId` | `uuid`                                               |          | Optional, because accountId names its profile. If you pass both, they must agree.                        |
| `banAuthor` | `"true" \| "false"`                                  |          | YouTube only: also hide the author's future comments on the channel, when the comment is someone else's. |

Returns `204`. Deleting cannot be undone.

> **Note: TikTok deletes only your own comments**
>
> On TikTok the account can delete only comments it wrote; anything else is
> `422 comment_not_owned`. Hide other people's comments instead — a hidden
> comment is visible only to its author.

> **Note: YouTube rejects other people's comments**
>
> On YouTube the channel's own comments are deleted. Anyone else's is rejected,
> which removes it for good — it cannot be published again — and, with
> `banAuthor=true`, also bans its author from commenting on the channel.

**Errors** — `401 unauthorized`, `400 invalid_request`, `404 account_not_found`,
`422 comment_not_owned`, `422 connection_expired`, `429 rate_limited`,
`502 provider_error`.

## Request examples

**cURL**

```bash
curl --fail-with-body -X DELETE "https://app.tryadeli.com/api/v1/comments/7301000000000000002?platform=tiktok&accountId=00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer $ADELI_API_KEY"
```

**JavaScript**

```javascript
const response = await fetch("https://app.tryadeli.com/api/v1/comments/7301000000000000002?platform=tiktok&accountId=00000000-0000-0000-0000-000000000000", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.ADELI_API_KEY}`,
  },
});
console.log(response.status); // 204: no body
```

**Python**

```python
import os

import requests

response = requests.delete(
    "https://app.tryadeli.com/api/v1/comments/7301000000000000002",
    headers={"Authorization": f"Bearer {os.environ['ADELI_API_KEY']}"},
    params={
        "platform": "tiktok",
        "accountId": "00000000-0000-0000-0000-000000000000",
    },
)
print(response.status_code)  # 204: no body
```

## Responses

### 204 No Content

```text
(empty body)
```

### 422

```json
{
  "error": {
    "code": "comment_not_owned",
    "message": "TikTok can delete only comments this account wrote; hide other comments instead"
  }
}
```
