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 can then use the comment's ID to send a private response directly to the Instagram user. This reply will be delivered in the person's Inbox folder, if the person follows the Instagram professional account, or to the person's Request folder, if the person does not follow the account. | ![]() |
Step 4. Your app can send this private reply within 7 days of the creation time of the comment, excepting Instagram Live for which your app can only send a private reply during the live broadcast. The private reply message will contain a link to the post that the person commented on.
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 will 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 person who commented on your app user's Instagram professional post, reel, or story, send a POST
request to the <APP_USERS_IG_ID>/messages
endpoint where the recipient
parameter contains the comment's ID and the message
parameter contains 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 }