
## Delete a post

`DELETE /v1/posts/:id`

Deletes a post from the Bitrix24 Feed. A deleted post cannot be restored via the API — create a new one if needed.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` | number | yes | Post ID (path parameter). List: [GET /v1/posts](/docs/feed/posts/list) |

## Examples

### curl — personal key

```bash
curl -X DELETE https://vibecode.bitrix24.com/v1/posts/303 \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE https://vibecode.bitrix24.com/v1/posts/303 \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/303', {
  method: 'DELETE',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
if (res.status === 204) {
  console.log('Post deleted')
}
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/303', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
if (res.status === 204) {
  console.log('Post deleted')
}
```

## Response

On successful deletion, HTTP status `204 No Content` is returned with an empty body. Success is indicated by the response code, not the body.

## Response example

```
HTTP/1.1 204 No Content
```

## Error response example

404 — post not found:

```json
{
  "success": false,
  "error": {
    "code": "POST_NOT_FOUND",
    "message": "Post 999999999 not found or not accessible with this key."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `POST_NOT_FOUND` | Post with the given `id` not found or not accessible with this key |
| 400 | `INVALID_POST_ID` | Invalid post `id` |
| 403 | `BITRIX_ACCESS_DENIED` | No permission to delete this post |
| 403 | `SCOPE_DENIED` | The API key lacks the `log` scope |
| 401 | `TOKEN_MISSING` | The API key has no access tokens configured |

The full list of common API errors — [Errors](/docs/errors).

## See also

- [Create a post](/docs/feed/posts/create)
- [Update a post](/docs/feed/posts/update)
- [Posts](/docs/feed/posts)
- [Feed](/docs/feed)
- [Errors](/docs/errors)
