Box Developer Documentation

Join BoxWorks 2024 to discover what's possible with content and AI!

Register now!

Remove comment

delete
https://api.box.com/2.0
/comments/:comment_id

Permanently deletes a comment.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
12345

The ID of the comment.

Response

none

Returns an empty response when the comment has been deleted.

application/jsonClient error

An unexpected client error.

delete
Remove comment
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X DELETE "https://api.box.com/2.0/comments/12345" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
TypeScript Gen
await client.comments.deleteCommentById(newComment.id!);
Python Gen
client.comments.delete_comment_by_id(new_comment.id)
.NET Gen
await client.Comments.DeleteCommentByIdAsync(commentId: NullableUtils.Unwrap(newComment.Id));
Swift Gen (Beta)
try await client.comments.deleteCommentById(commentId: newComment.id!)
Java
BoxComment comment = new BoxComment(api, "id");
comment.delete();
Python
client.comment(comment_id='12345').delete()
.NET
await client.CommentsManager.DeleteAsync(id: "11111");
Node
client.comments.delete('11111')
    .then(() => {
        // deletion successful — no value returned
    });
iOS
client.comments.delete(commentId: "55555") { (result: Result<Void, BoxSDKError>) in
    guard case .success = result else {
        print("Error deleting comment")
        return
    }

    print("Comment deleted")
}