Skip to main content

Instagram

Instagram posting requires a professional Instagram account connected to a Facebook Page. Media must be reachable through a public URL before Instagram can create the post.

Content support

CapabilitySupport
CaptionUp to 2200 characters.
Required mediaYes, at least one image or video.
MediaImages and videos. Mixed image + video carousels are supported.
Media limit1–10 items total.
Public media URLRequired by the Instagram API.

A single video is published as a Reel. Multiple items are published as a carousel.

Set up credentials

1. Switch to a professional Instagram account

In Instagram settings, switch the account to Business or Creator.

2. Connect a Facebook Page

Connect the Instagram account to a Facebook Page you manage. This usually creates or links a Meta business portfolio.

3. Create a Meta developer app

Open Meta Apps and create an app. Choose the legacy or business flow that exposes the Instagram product and permissions.

4. Add Instagram

Add the Instagram product to the app. This unlocks Instagram Graph API permissions.

5. Generate a page access token

Use Graph API Explorer:

  1. Select your app.
  2. Choose Get Page Access Token.
  3. Add permissions:
pages_show_list
business_management
instagram_basic
instagram_content_publish
pages_manage_posts
  1. Grant access.
  2. Call /me/accounts.
  3. Copy the Page Access Token and Page ID.

6. Get the Instagram business account ID

Call:

<PAGE_ID>?fields=instagram_business_account

The returned instagram_business_account.id is the value SimplePost needs.

7. Extend the token

Use the Access Token Debugger to extend the user token, then call /me/accounts again to get a long-lived Page token.

8. Configure media storage

Instagram requires public media URLs. Configure media storage so SimplePost can upload local files and pass back fetchable URLs.

Environment variables

INSTAGRAM_ACCESS_TOKEN=
INSTAGRAM_BUSINESS_ACCOUNT_ID=

Both variables must be set together for the SDK to pick up Instagram env credentials.

SDK example

await post({
content: {
text: "Photo dump",
media: [
{ type: "image", path: "./photo1.jpg" },
{ type: "image", path: "./photo2.jpg" },
],
},
platforms: ["instagram"],
});

The credentials object also accepts graphApi: "instagram" (the default) or graphApi: "facebook" if your token was issued through the Facebook Graph API rather than the Instagram Graph API.

REST server account

Add this entry under accounts in the self-hosted REST server's accounts.json:

{
"id": "ig-business",
"platform": "instagram",
"credentials": {
"accessToken": "...",
"businessAccountId": "17841...",
"graphApi": "instagram"
}
}