Mentions
Updated: Jun 8, 2021
Copy for LLM
Identify captions, comments, and IG Media in which an Instagram Business or Creator’s alias has been tagged or @mentioned.
Limitations
- Mentions on Stories are not supported.
- Commenting on photos in which you were tagged is not supported.
- Webhooks will not be sent if the Media upon which the comment or @mention appears was created by an account that is set to private.
Endpoints
The API consists of the following endpoints:
GET /{ig-user-id}/tags— to get the media objects in which a Business or Creator Account has been taggedGET /{ig-user-id}?fields=mentioned_comment— to get data about a comment that an Business or Creator Account has been @mentioned inGET /{ig-user-id}?fields=mentioned_media— to get data about a media object on which a Business or Creator Account has been @mentioned in a captionPOST /{ig-user-id}/mentions— to reply to a comment or media object caption that a Business or Creator Account has been @mentioned in by another Instagram user
Refer to each endpoint reference document for usage instructions.
Webhooks
Subscribe to the
mentions field to recieve Instagram Webhooks notifications whenever an Instagram user mentions an Instagram Business or Creator Account. Note that we do not store Webhooks notification data, so if you set up a Webhook that listens for mentions, you should store any received data if you plan on using it later.Examples
Listening for and Replying to Comment @Mentions
You can listen for comment @mentions and reply to any that meet your criteria:
- Set up an Instagram webhook that’s subscribed to the
mentionsfield. - Set up a script that can parse the Webhooks notifications and identify comment IDs.
- Use the IDs to query the
GET /{ig-user-id}/mentioned_commentendpoint to get more information about each comment. - Analyze the returned results to identify any comments that meet your criteria.
- Use the
POST /{ig-user-id}/mentionsendpoint to reply to those comments.
The reply will appear as a sub-thread comment on the comment in which the Business or Creator Account was mentioned.
Listening for and Replying to Caption @Mentions
You can listen for caption @mentions and reply to any that meet your criteria:
- Set up an Instagram webhook that’s subscribed to the
mentionsfield. - Set up a script that can parse the Webhooks notifications and identify media IDs.
- Use the IDs to query the
GET /{ig-user-id}/mentioned_mediaendpoint to get more information about each media object. - Analyze the returned results to identify media objects with captions that meet your criteria.
- Use the
POST /{ig-user-id}/mentionsendpoint to comment on those media objects.