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
| Capability | Support |
|---|---|
| Caption | Up to 2200 characters. |
| Required media | Yes, at least one image or video. |
| Media | Images and videos. Mixed image + video carousels are supported. |
| Media limit | 1–10 items total. |
| Public media URL | Required 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:
- Select your app.
- Choose Get Page Access Token.
- Add permissions:
pages_show_list
business_management
instagram_basic
instagram_content_publish
pages_manage_posts
- Grant access.
- Call
/me/accounts. - 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"
}
}