Facebook Comments API: Read, Reply, Hide, Delete
The Facebook comments API is the Graph API's comments edge. With a Page access token you read comments on a Page's posts with GET on the post's comments edge, reply by POSTing a message to a comment, hide with is_hidden, and delete with DELETE. It needs pages_read_user_content and pages_manage_engagement, and it doesn't reach personal profiles. Adeli reads, replies to, and moderates comments on any post of a connected Page.
The Facebook comments API is the Graph API's comments edge. With a Page access token you can read the comments on a Page's posts, reply as the Page, hide comments, and delete them. Reading other people's comments needs pages_read_user_content, and writing needs pages_manage_engagement. None of it works on personal profiles.
Each operation below comes with a request built from Meta's docs. After those come the permissions, private replies, webhooks, and the errors behind most "my comments are empty" bugs.
What can the Facebook comments API do?
Five operations, all on posts of a Page your token can moderate. Requests go to graph.facebook.com, per Meta's comments edge reference and Comment reference.
| Operation | Request | Key parameter |
|---|---|---|
| List comments on a post | GET /{page-post-id}/comments |
filter, summary, fields |
| Reply to a comment | POST /{comment-id}/comments |
message |
| Comment on the Page's post | POST /{page-post-id}/comments |
message, or an image |
| Hide or unhide a comment | POST /{comment-id} |
is_hidden=true or false |
| Delete a comment | DELETE /{comment-id} |
none |
The same POST /{comment-id} call also edits a comment's message, which only works on comments the Page wrote. To get post IDs in the first place, read the Page's feed or the response from publishing a Page post.
Which permissions does the Facebook comments API need?
Two Page permissions, plus a Page access token. The descriptions come from Meta's permissions reference:
| Permission | What Meta says it allows | Depends on |
|---|---|---|
pages_read_user_content |
Read user-generated content on the Page, "such as posts, comments, and ratings," and delete user comments on Page posts | pages_show_list |
pages_manage_engagement |
"Create, edit and delete comments posted on the Page" | pages_read_user_content, pages_show_list |
pages_read_engagement |
Read content the Page itself posted, plus follower names and PSIDs | pages_show_list |
pages_messaging |
Private replies to commenters (see below) | pages_manage_metadata, pages_show_list |
The permissions alone aren't enough:
- Use a Page token, not a user token. Meta's Page comments guide requires a Page access token, and the comments edge returns empty data for posts read with a User access token. Our Page access token guide shows how to get one that doesn't expire.
- The person needs the MODERATE task on the Page. Publishing a comment needs a token from someone who can moderate, and so does getting comment IDs.
- Customers' Pages need Advanced Access. Standard Access covers Pages managed by people with a role on your app. When customers connect their own Pages, you need App Review and Business Verification. The Meta app review guide covers the timeline.
How to get comments from a Facebook post with the API
Call the post's comments edge with a Page token and the fields you want.
curl -G "https://graph.facebook.com/v26.0/<PAGE_POST_ID>/comments" \
-d "access_token=<PAGE_ACCESS_TOKEN>" \
-d "filter=stream" \
-d "summary=true" \
--data-urlencode "fields=id,from,message,created_time,comment_count,can_reply_privately"The response has a data array with each comment's from.name, from.id (the commenter's Page-scoped ID), message, id, and created_time, plus paging cursors. The comments edge reference defines the two reading parameters:
filter.toplevel(the default) returns top-level comments only.streamreturns every comment, replies included, in chronological order.summary. Addstotal_countandorder, which is eitherchronologicalorreverse_chronological. There's no documentedorderrequest parameter.
Why the list looks short. Meta documents three causes:
- The default filter hides replies. Switch to
filter=stream, or read each comment's owncommentsedge. total_countovercounts. Meta says it can be higher than the comments returned "due to comment privacy or deletion."- Very large threads hit paging limits. Meta warns that objects with tens of thousands of comments may not page to the end.
How to reply to a Facebook comment with the API
POST a message to the comment's own comments edge. The Page is the author.
curl -X POST "https://graph.facebook.com/v26.0/<COMMENT_ID>/comments" \
-d "access_token=<PAGE_ACCESS_TOKEN>" \
-d "message=Thanks for asking. The new hours start Monday."A successful call returns the new comment's ID as {"id": "..."}. From the Page comments guide and the comments edge reference:
- Check
can_commentfirst. It tells you whether a comment accepts replies. - Images and GIFs work too. Send
attachment_urlfor an image,attachment_share_urlfor a GIF, orattachment_idfor an unpublished photo, instead of or alongsidemessage. - Mentions are limited. A Page can @mention someone with
@[PSID]only if that person commented on the Page's post or wrote it, and the Page's settings allow others to tag it. - Unpublished Pages can't comment. Meta says no one can comment on a post of an unpublished Page.
To add a top-level comment on the Page's own post, send the same request to /{page-post-id}/comments.
How to hide or delete a Facebook comment
Hide with is_hidden=true, delete with a DELETE request. Hiding can be undone, so it's the safer moderation default.
# Hide (send is_hidden=false to show it again)
curl -X POST "https://graph.facebook.com/v26.0/<COMMENT_ID>" \
-d "access_token=<PAGE_ACCESS_TOKEN>" \
-d "is_hidden=true"
# Delete
curl -X DELETE "https://graph.facebook.com/v26.0/<COMMENT_ID>?access_token=<PAGE_ACCESS_TOKEN>"Both return {"success": true}. What the Comment reference and the permissions reference say:
is_hiddenonly applies to Page comments. Meta describes the field as "Only applicable to Page comments," so it won't hide comments anywhere else.- Hiding falls under moderation. The Comment reference doesn't name the permission for hiding.
pages_manage_engagementis the one whose allowed use is "manage and moderate content on the Page," so request it. - Deleting other people's comments is allowed on your Page. Both
pages_read_user_contentandpages_manage_engagementlist deleting comments on Page posts. Deleting can't be undone.
Can you send a private reply to a Facebook commenter?
Yes, one message, within 7 days of the comment. Meta's private replies guide sends a Messenger message to the person who commented, using the comment ID as the recipient:
curl -X POST "https://graph.facebook.com/v26.0/<PAGE_ID>/messages?access_token=<PAGE_ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"recipient":{"comment_id":"<COMMENT_ID>"},"message":{"text":"Sending you the order link here."}}'- One message only. If the person replies, the normal 24-hour messaging window opens.
- 7 days from the comment's creation, not from when you saw it.
- Different permission. It needs
pages_messagingand a token from someone with the MESSAGING task on the Page. - No replies to Pages. You can't send a private reply to another Facebook Page.
The comment's can_reply_privately field tells you whether a private reply is still possible.
How to get new Facebook comments in real time
Subscribe your app to the Page's feed webhook. Meta's Page webhooks reference sends events with item: comment and a verb such as add, edited, remove, hide, or unhide, along with comment_id and parent_id.
- It needs
pages_manage_metadata, granted by a Page admin with MODERATE. - Ad comments are included. Meta doesn't send webhooks for ad posts themselves, but does for comments on them.
- Fetch the comment afterward with
GET /{comment-id}if the payload leaves out a field you need.
Meta's private replies guide also recommends the feed webhook over polling the Page's feed, to stay clear of rate limits.
Which Facebook comments can't the API reach?
Anything outside a Page your token can moderate. The limits, from Meta's comments references:
| You want | Works? | Why |
|---|---|---|
| Comments on your Page's posts | Yes | Page token with the permissions above |
| Comments on another company's Page | No, not usefully | Apps using Page Public Content Access no longer get comment IDs, so you can't reply or moderate |
| Comments on a personal profile's posts | No | User tokens get empty data on posts, and other people's comments need their own authorization |
| Comments in Groups | No | Meta deprecated the Groups API in Graph API v19.0 (more on that) |
| Commenting as a person | No | Comments post as the Page; commenting as a user returns error 1705 |
Common errors to handle: 283 (missing pages_read_engagement or pages_read_user_content), 200 (permissions), 190 (invalid or expired token), and 368 (Meta blocked the action as abusive, often from repeated identical replies).
Is there a faster way to manage Facebook comments?
Yes, if you don't want to run the Meta side yourself. Building this directly means a Meta app, Advanced Access for two comment permissions, Business Verification, a feed webhook, and a Page token for every customer.
The review is usually the slowest part. When we went through Meta's review for the comment permissions, the written use case was the easy half. Expect the screencast to be judged hardest: the Meta login, the user granting the permission, choosing the Page, and the comment being read and answered on screen, end to end.
Adeli's Facebook API removes that work. Adeli maintains the Facebook developer app, carries Meta's review, and refreshes every connected Page's tokens, so you hold one API key. It reads, replies to, and moderates comments on any post of a connected Page, including posts made outside Adeli. Here's a reply through Reply or comment:
curl -X POST "https://app.tryadeli.com/api/v1/comments" \
-H "Authorization: Bearer $ADELI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"platform": "facebook",
"accountId": "00000000-0000-0000-0000-000000000000",
"parentId": "<COMMENT_ID>",
"message": "Thanks for asking. The new hours start Monday."
}'How Adeli maps to the Facebook behavior above:
- List comments returns the Page's newest 25 posts and the comments on one of them, newest first, with replies carrying
parentId. - Reads answer from Adeli's copy, refreshed from Facebook in the background when it's more than a minute old, with
syncedAtandcompleteon every response. - Reply or comment takes
parentIdfor a reply orpostIdalone for a comment on the Page's own post, up to 8,000 characters. - Hide is a PATCH with
hidden: trueorfalse. Delete works on any comment on the Page's posts. - Two states to handle in your UI. A connection without a chosen Page returns
409 page_not_selected. A connection made before the comment permission was requested returns422 connection_expired, and reconnecting fixes it.
The same endpoints cover Instagram comments and TikTok comments, plus YouTube. See the commenting API for the cross-network view. One Facebook Page is one connected account, and on Adeli's pricing your first 3 connected accounts are free.