This documents shows you how to programmatically send a private reply to a person who commented on your app user's Instagram professional post, reel, story, Live, or ad post.
Step 1. An Instagram user comments on your app user's Instagram professional post, reel, story, Live, or ad post.
Step 2. A webhook event is triggered and Meta sends your server a notification with information about the comment including:
Step 3. Your app uses the comment's ID to send a private response directly to the Instagram user. This reply appears in the person's Inbox, if the person follows the Instagram professional account, or to the Request folder, if they do not. | ![]() |
Step 4. Your app can send this private reply within 7 days of the creation time of the comment, excepting Instagram Live, where replies can only be sent during the live broadcast. The private reply message includes a link to the commented post.
This guide assumes you have read the Instagram Platform Overview and implemented the needed components for using this API, such as a Meta login flow and a webhooks server to receive notifications.
You need the following:
Instagram API with Instagram Login | Instagram API with Facebook Login | |
---|---|---|
Access Tokens |
| |
Host URL |
|
|
Login Type | Business Login for Instagram | Facebook Login for Business |
Permissions |
|
If the app user was granted a role on the Page connected to your app user's Instagram professional account via the Business Manager, your app will also need:
|
Webhooks |
|
|
To send a private reply to a commenter on your app user's Instagram professional post, reel, or story, send a POST
request to the <APP_USERS_IG_ID>/messages
endpoint. The recipient
parameter should contain the comment's ID and the message
parameter should contain the text you wish to send.
curl -i -X POST "https://<HOST_URL>/<API_VERSION>/<APP_USERS_IG_ID>/messages" -H "Content-Type: application/json" -H "Authorization: Bearer <ACCESS_TOKEN>" -d '{ "recipient":{ "comment_id": "<COMMENT_ID>" }, "message": { "text": "<COMMENT_TEXT>" } }'
On success, your app receives a JSON response with the recipient's Instagram-scoped ID and the ID for the message.
{ "recipient_id": "526...", // The Instagram-scoped ID "message_id": "aWdfZ..." // The ID for the private reply message }