Skip to main content

Instagram

Connects to the Instagram Graph API. An agent can publish photo posts, Reels, and Stories, read recent media and comments, reply to/hide/delete comments, send DMs, fetch post insights, and look up public profile info.

This connector's tools are also used by the instagram-send workflow node.

Add to an agent node's tools array with _node_type: "tool-instagram". See Connector Reference — How connectors are used.

Authentication

FieldRequiredDescription
access_tokenYes (or token)Long-lived Page or User access token.
tokenYes (or access_token)Used if access_token is not set.
instagram_account_idYesInstagram Business/Creator account ID.
{
"name": "instagram",
"_node_type": "tool-instagram",
"access_token": "{{ secret.INSTAGRAM_ACCESS_TOKEN }}",
"instagram_account_id": "{{ secret.INSTAGRAM_ACCOUNT_ID }}"
}

To obtain credentials: create a Meta App at developers.facebook.com, add the "Instagram" product and connect your Instagram Business account, generate a long-lived token via GET /oauth/access_token?grant_type=fb_exchange_token, and find instagram_account_id via GET /me/accounts → Page ID, then GET /{page-id}?fields=instagram_business_account.

Tools

instagram_create_post

Publish a photo post to an Instagram Business or Creator account feed. The image must be a publicly accessible URL.

Parameters

ParameterTypeRequiredDescription
image_urlstringYesPublicly accessible URL of the image to post (JPEG or PNG)
captionstringNoPost caption. Supports hashtags and @mentions (max 2200 chars)
location_idstringNoFacebook Page ID of a location to tag (optional)
alt_textstringNoAccessibility alt text for the image (optional)

Returns: A confirmation message with the new media ID and a link to the post.

instagram_create_reel

Publish a Reel (short video) to an Instagram account. The video must be a publicly accessible MP4 URL.

Parameters

ParameterTypeRequiredDescription
video_urlstringYesPublicly accessible URL of the video file (MP4 H.264 recommended)
captionstringNoReel caption with hashtags and @mentions (max 2200 chars)
audio_namestringNoDisplay name for the audio in Reels (optional)

Returns: A confirmation message with the new Reel's media ID.

instagram_create_story

Publish a photo or video story to an Instagram account.

Parameters

ParameterTypeRequiredDescription
media_urlstringYesPublicly accessible URL of image (JPEG/PNG) or video (MP4) for the story
media_typestringNoMedia type: IMAGE or VIDEO (default IMAGE)

Returns: A confirmation message with the new media ID and the resolved media type.

instagram_get_media

Retrieve recent media posts (photos, videos, reels) from an Instagram account with engagement metrics.

Parameters

ParameterTypeRequiredDescription
limitnumberNoNumber of recent posts to return (default 10, max 50)

Returns: A list of posts, each showing date, media ID, media type, like/comment counts, a truncated caption, and the permalink — or "No media found.".

instagram_get_comments

Get comments on an Instagram media post. Returns commenter username, text, timestamp, and like count.

Parameters

ParameterTypeRequiredDescription
media_idstringYesInstagram media ID to get comments for
limitnumberNoMax comments to return (default 20)

Returns: A newline-separated list of [date] @username (id: <id>, ❤️<likes>): <text> lines, or "No comments found.".

instagram_reply_comment

Reply to an Instagram comment on a post. The reply will appear as a threaded response.

Parameters

ParameterTypeRequiredDescription
comment_idstringYesID of the comment to reply to
messagestringYesReply text. Can include @username to mention the commenter

Returns: A confirmation message with the new reply's ID and the comment it replied to.

instagram_delete_comment

Permanently delete a comment from an Instagram post. Can delete comments on posts owned by the authenticated account.

Parameters

ParameterTypeRequiredDescription
comment_idstringYesID of the comment to delete

Returns: A confirmation message that the comment was deleted, or an error if the API reports success=false.

instagram_hide_comment

Hide or unhide a comment on an Instagram post. Hidden comments are visible to the commenter but not others.

Parameters

ParameterTypeRequiredDescription
comment_idstringYesID of the comment to hide or unhide
hidebooleanNotrue to hide the comment from public view, false to unhide it

Returns: A confirmation message stating the comment was hidden or unhidden, or an error if the API reports success=false.

instagram_send_dm

Send a direct message (DM) to an Instagram user. Only works within the 7-day messaging window (24h standard, 7 days with human agent tag). User must have messaged first.

Parameters

ParameterTypeRequiredDescription
recipient_idstringYesInstagram user ID or IGSID of the recipient
textstringYesMessage text to send (max 1000 chars)

Returns: A confirmation message with the new message ID and recipient user ID.

instagram_get_insights

Get performance insights for an Instagram post: impressions, reach, saves, shares, and profile visits.

Parameters

ParameterTypeRequiredDescription
media_idstringYesInstagram media ID to get insights for

Returns: A list of <metric>: <value> lines (impressions, reach, saved, shares, profile_visits, likes, comments) for the media, or a note that insights are unavailable (account may need Business/Creator status).

instagram_get_user_info

Look up basic profile information for an Instagram user by username: follower count, following count, bio, and post count.

Parameters

ParameterTypeRequiredDescription
usernamestringYesInstagram username to look up (without @)

Returns: The user's name, bio, follower/following/post counts, and website (via the Business Discovery API), or an error if the user is not found or not a Business/Creator account.

Next