Manage an Instagram professional account via the Instagram Graph API: profile, media, publishing, comments, mentions, hashtag search and insights.
Instagram for Business ships in the w6w first-party pack. It declares 26 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.
io.w6w.instagram-for-businessThis app works with an Instagram professional account (a Business or Creator account) through Meta’s Instagram Graph API, reached with Facebook Login. It reads the account’s profile and media, publishes new photos, reels, stories and carousels through Instagram’s two-step container flow, and moderates the conversation underneath: reading comments and replies, replying, hiding, deleting, and switching comments on or off for a post.
It also surfaces what other people do around the account: media the account has been tagged in, media whose caption @mentions it, and a reply action for those mentions. Hashtag search (find a hashtag’s id, then read its recent or top public media) and account and media insights round it out, along with a check of the account’s remaining daily publishing allowance so a workflow can see headroom before it posts.
The app deliberately targets the Facebook Login flavour of Meta’s API (graph.facebook.com): the account is reached through the Facebook Page it is linked to, and the Pages list action finds the Instagram account id every other action needs. It is distinct from the Facebook Pages app in this pack, which manages the Page itself rather than the Instagram account behind it.
Three routes to the same 26 actions. The Workflow tab is generated from Instagram for Business's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.
create-carousel-container Publishing step 1 for a carousel: bundle up to 10 item containers into one post.
create-media-container Publishing step 1: create a container for a photo, video, reel or story (or a carousel item) from a public URL.
get-account-insights Read account-level metrics such as reach, views and engagement.
get-container-status Check whether a media container is ready to publish (status_code FINISHED).
get-mentioned-media Read a post whose caption @mentions the account, by the media id from a mention webhook.
get-publishing-limit Check how many posts the account has published via the API in the last 24 hours.
list-hashtag-recent-media Public media tagged with a hashtag in the last 24 hours.
list-instagram-accounts List the Facebook Pages you manage together with the Instagram professional account linked to each.
list-tagged-media List posts in which the account was tagged by other Instagram users.
publish-container Publishing step 2: publish a finished media or carousel container.
reply-to-mention Comment on a post whose caption @mentions the account, or reply to a comment that @mentions it.
search-hashtag Look up the id of a hashtag (without the #) for use with hashtag media actions.
set-comments-enabled Turn comments on or off for one of the account's posts.
A workflow step names the app and the action, and the editor fills in the
connection when you pick one. This is the Step shape from the
workflow spec, carrying Instagram for Business's real ids.
{
"manifestVersion": "2",
"name": "instagram-for-business-example",
"steps": [
{
"id": "create-carousel-container",
"uses": {
"app": "io.w6w.instagram-for-business",
"action": "create-carousel-container",
"connection": "conn_YOUR_CONNECTION_ID"
},
"with": {
"igUserId": "<igUserId>",
"children": "<children>"
}
}
]
}create-carousel-container create-comment create-media-container get-account get-account-insights +21 more actions available
Every app-specific value here is a blank you have to fill in. An
app action is reached through the connection that authenticates it, so the
address is a connection id, not the app id — and connections belong to your account,
so a public page cannot know yours. Create one for Instagram for Business, then fill in
the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the
parameters that action declares. The call itself is real — the shape is transcribed
from the studio's own snippet builder, which prints the same kind of blanks — but
nothing in it is specific to Instagram for Business. The Workflow tab is where this app's
real ids are.
npm install @w6w/sdkyarn add @w6w/sdkpnpm add @w6w/sdkdeno add npm:@w6w/sdkimport { W6wClient, isActionRun } from "@w6w/sdk";
// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();
const envelope = await client.run({
urn: "conn_YOUR_CONNECTION_ID",
action: "create-carousel-container",
payload: {
igUserId: "<value>",
children: "<value>",
// caption: "<value>",
// locationId: "<value>",
// collaborators: "<value>",
// isAiGenerated: "<value>",
},
});
if (isActionRun(envelope)) console.log(envelope.value); npm install -g @w6w/cli w6w run conn_YOUR_CONNECTION_ID --action create-carousel-container --payload '{"igUserId":"<value>","children":"<value>"}' Give an AI agent Instagram for Business — without giving it Instagram for Business's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.
One tool call{
"name": "w6w_invoke",
"arguments": {
"ref": "app:io.w6w.instagram-for-business#create-carousel-container",
"input": {
"igUserId": "<igUserId>",
"children": "<children>"
}
}
}
Every tool names its target with a single ref. The
app: form above doesn't name a connection at all — the
host resolves which of the caller's Instagram for Business connections to sign
with, and refuses rather than guesses when the answer is ambiguous.
The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.
Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.
Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.
Instagram for Business's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.
The MCP surface is part of the hosted platform. Instagram for Business itself is MIT, and the runtime that executes it is source-available (FSL).
Instagram for Business declares its own checks, so its health is a property of the app rather than something the host guesses at.
Meta's own outage-events feed for the Graph API (metastatus.com).
Percentage of the app's call-count, CPU-time and total-time allowances consumed, read off `X-App-Usage`. Meta throttles when any meter reaches 100.