For AI agents: markdown of this page — /docs-content-en/feed/comments/delete.md documentation index — /llms.txt
Delete a comment
DELETE /v1/posts/:id/comments/:commentId
Deletes a comment from a Feed post. A deleted comment cannot be restored via the API — create a new one if needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid |
Typenumber | Requiredyes | DescriptionPost ID (path parameter). List: GET /v1/posts |
ParametercommentId |
Typenumber | Requiredyes | DescriptionComment ID (path parameter). Returned in the response of POST /v1/posts/:id/comments |
Examples
curl — personal key
curl -X DELETE https://vibecode.bitrix24.com/v1/posts/118/comments/41 \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE https://vibecode.bitrix24.com/v1/posts/118/comments/41 \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/118/comments/41', {
method: 'DELETE',
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
if (res.status === 204) {
console.log('Comment deleted')
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/posts/118/comments/41', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Comment deleted')
}
Response
On successful deletion the API returns HTTP status 204 No Content with an empty body. Success is indicated by the response code, not the content.
Response example
HTTP/1.1 204 No Content
Error response example
403 — no permission to delete:
{
"success": false,
"error": {
"code": "COMMENT_ACCESS_DENIED",
"message": "No delete perms"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_COMMENT_ID |
DescriptionAn invalid comment identifier was provided |
| HTTP403 | CodeCOMMENT_ACCESS_DENIED |
DescriptionNo permission to delete this comment |
| HTTP404 | CodeCOMMENT_NOT_FOUND |
DescriptionNo comment found with the given commentId |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key lacks the log scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no access tokens configured |
The full list of common API errors — Errors.