Tesselith
ProductSolutionsAI agentsCompareFree toolsBlogPricing
Log inStart free
  1. Home/
  2. Blog/
  3. Publishing to Instagram with the Graph API: Containers, Status Polling, Carousels and Reels

Developers

Publishing to Instagram with the Graph API: Containers, Status Polling, Carousels and Reels

November 27, 2026 · 8 min read

How Instagram Graph API publishing works in 2026: media containers, status polling, carousels, Reels, limits, token refresh and the errors that break real apps.

Publishing to Instagram through the Graph API is always two steps. First you create a media container by POSTing a public URL to /<IG_ID>/media. Instagram fetches the file and processes it. When the container's status_code is FINISHED, you POST its id to /<IG_ID>/media_publish and the post goes live. Carousels repeat the container step once per slide plus once for the album. An account can publish 100 posts through the API in a rolling 24 hours and create 400 containers in the same window. Images must be JPEG.

Key takeaways

  • Create a container, wait for status_code FINISHED, then call media_publish. Publishing early fails.
  • Only JPEG images are accepted. PNG fails at container creation.
  • Carousels take 2 to 20 items. A video inside a carousel is media_type VIDEO, never REELS.
  • Limits: 100 API-published posts and 400 containers per account per rolling 24 hours. Containers expire after 24 hours.
  • Long-lived tokens last 60 days. Refresh them before they expire or the user has to log in again.

Pick your login flavor first

Meta offers two ways to reach the same publishing endpoints, and the choice decides your host name, your token type and which features you get.

Instagram API with Instagram LoginInstagram API with Facebook Login
Hostgraph.instagram.comgraph.facebook.com
Needs a linked Facebook PageNoYes
Account typesBusiness or CreatorBusiness or Creator linked to a Page
TokenInstagram user tokenFacebook user token, then the Page's IG account
Resumable video upload (rupload)NoYes
Collaborators on postsNoYes

We built Tesselith's Instagram integration on Instagram Login because most small accounts don't have, or can't find, the Facebook Page linked to their profile. The cost is two missing features: resumable uploads and collaborators. If your users are agencies with tidy Business Manager setups, Facebook Login is fine. If they're creators, Instagram Login removes the most common support ticket.

With Instagram Login, request instagram_business_basic and instagram_business_content_publish. Add instagram_business_manage_comments and instagram_business_manage_insights if you'll post first comments or read metrics. Every one of them goes through Meta's App Review before real users can grant it.

Step 1: create a media container

The container call doesn't take file bytes. It takes a URL, and Meta's servers download from it. The URL must be public, must not redirect to a login page, and must stay up until processing finishes. Signed URLs with a 60-second expiry are a classic way to fail here. Give them at least an hour.

curl -X POST "https://graph.instagram.com/v27.0/$IG_ID/media" \
  -d "image_url=https://cdn.example.com/posts/bake-0700.jpg" \
  --data-urlencode "caption=Sourdough out of the oven at 7. Back at 2 for focaccia." \
  --data-urlencode "alt_text=Six sourdough loaves cooling on a wire rack" \
  -d "access_token=$IG_ACCESS_TOKEN"

# {"id": "17889455560051444"}  <- the container id, not a post id

v27.0 is the current Graph API version as of November 2026. Pin it explicitly. Meta changes container parameters between versions, and an unversioned call falls back to your app's default version, which may not be the one you tested.

Step 2: poll the container status

Read status_code on the container. It returns one of five values:

status_codeMeaningWhat to do
IN_PROGRESSMeta is still fetching or transcodingWait and poll again
FINISHEDReady to publishCall media_publish
PUBLISHEDAlready publishedTreat as success, don't publish again
ERRORProcessing failedStop. Read the status field for the reason
EXPIREDNot published within 24 hoursCreate a new container
async function waitForContainer(id: string, token: string, budgetMs: number) {
  const deadline = Date.now() + budgetMs
  while (Date.now() < deadline) {
    const url = "https://graph.instagram.com/v27.0/" + id +
      "?fields=status_code,status&access_token=" + encodeURIComponent(token)
    const data = await fetch(url).then((r) => r.json())
    if (data.status_code === "FINISHED" || data.status_code === "PUBLISHED") return
    if (data.status_code === "ERROR" || data.status_code === "EXPIRED") {
      throw new Error("Container " + data.status_code + ": " + data.status)
    }
    await new Promise((r) => setTimeout(r, 3000))
  }
  throw new Error("Still processing. Check the account before retrying.")
}

Meta's guide suggests checking about once a minute for no more than five minutes. That's tuned for video. A JPEG is usually ready within a few seconds, so we poll every three seconds with a 45-second budget for images and a 5-minute budget for video. Whatever you choose, make the budget depend on the media type. A 15-minute Reel genuinely takes minutes.

Treat ERROR and EXPIRED as final. Retrying the same container does nothing, and creating a fresh one for a file Meta already rejected burns another slot from your 400-a-day allowance. A timeout is different: the container may finish a minute later and publish fine, so mark it retryable and tell the user to check the account first.

Step 3: publish

curl -X POST "https://graph.instagram.com/v27.0/$IG_ID/media_publish" \
  -d "creation_id=$CONTAINER_ID" \
  -d "access_token=$IG_ACCESS_TOKEN"

# {"id": "18027939643016070"}  <- the published media id

The 100-posts-a-day limit is enforced here, on media_publish, and a carousel counts as one post. Check current usage with GET /<IG_ID>/content_publishing_limit before a big batch. One section of Meta's own guide still says 50 posts per 24 hours while the rate-limit section says 100, so read the endpoint rather than hard-coding either number.

Publishing a carousel

A carousel is 2 to 20 child containers plus one parent. Create each child with is_carousel_item=true and no caption, wait for each to finish, then create the parent with media_type=CAROUSEL, the caption, and a comma-separated children list. Publish the parent.

# Child (repeat per slide)
curl -X POST "https://graph.instagram.com/v27.0/$IG_ID/media" \
  -d "image_url=https://cdn.example.com/slide-1.jpg" \
  -d "is_carousel_item=true" \
  -d "access_token=$IG_ACCESS_TOKEN"

# A video slide is VIDEO, not REELS
curl -X POST "https://graph.instagram.com/v27.0/$IG_ID/media" \
  -d "video_url=https://cdn.example.com/slide-2.mp4" \
  -d "media_type=VIDEO" -d "is_carousel_item=true" \
  -d "access_token=$IG_ACCESS_TOKEN"

# Parent
curl -X POST "https://graph.instagram.com/v27.0/$IG_ID/media" \
  -d "media_type=CAROUSEL" \
  -d "children=$CHILD_1,$CHILD_2,$CHILD_3" \
  --data-urlencode "caption=Three ways to use leftover starter" \
  -d "access_token=$IG_ACCESS_TOKEN"

Gotchas from production: every image in a carousel is cropped to the first image's aspect ratio, so put your 4:5 image first if you want a 4:5 carousel. Caption, location and the AI-generated label belong on the parent only, and some of them error if you set them on a child. If one child fails, the whole carousel fails, so validate every file before you create the first container.

Publishing Reels and Stories

A Reel is a container with media_type=REELS and a video_url. Meta's reference, as of November 2026, allows MOV or MP4 between 3 seconds and 15 minutes, up to 300 MB, 23-60 fps, at most 1920 pixels wide, with the moov atom at the front of the file and no edit lists. 9:16 avoids cropping.

  • cover_url sets a custom cover image (JPEG, up to 8 MB). If you send it, Meta ignores thumb_offset, so send one or the other.
  • share_to_feed=false keeps the Reel off the main grid. It's true by default.
  • trial_params makes it a trial Reel shown to non-followers first, with a graduation strategy of MANUAL or SS_PERFORMANCE.
  • alt_text is for images only. Sending it on a Reel or Story returns an error rather than being ignored.

Stories use media_type=STORIES with either an image or a video URL. They take no caption. Link stickers, polls and music aren't available through the API. Our guide to scheduling Instagram Reels covers the creative side, and the image size cheat sheet has the ratios.

Image rules that fail at container creation

RuleValue (Meta docs, Nov 2026)
FormatJPEG only (no PNG, MPO or JPS)
File size8 MB max
Aspect ratio4:5 to 1.91:1
WidthScaled to 320-1440 px
Caption2,200 characters
Hashtags5 in the app since the December 2025 change; the API reference still says 30
User tags20 per image

Convert PNGs to JPEG on upload, not at publish time. A scheduled post can sit for days, and you want the failure while the author is still looking at the composer, not at 7am on launch day. We validate twice: in the composer, and again right before creating the first container, because the media attached to a scheduled post can change after it was approved.

Tokens: 60 days, then gone

Instagram Login gives you a short-lived token from the code exchange. Swap it straight away for a long-lived one with grant_type=ig_exchange_token. Long-lived tokens last 60 days and can be refreshed once they're at least 24 hours old with GET https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token. Note that token exchange and refresh live at the unversioned host root, while everything else is versioned. Building one URL by string-editing the other breaks the day you bump versions.

Run a daily job that refreshes any token expiring in the next week or so. If a refresh fails with an auth error, stop retrying and ask the user to reconnect. A scheduler that lets tokens lapse finds out when a week of posts fails at once.

Errors worth classifying

Meta returns errors in a JSON body with a numeric code, sometimes with HTTP 200 around it. Classify on the body, not the status.

CodeMeaningRetry?
190Token expired or revokedNo. Flag the account for reconnection
4, 17, 32, 613App, user or account rate limitingYes, with a long backoff
1, 2Transient Meta errorYes
100Invalid parameter (bad URL, wrong field for the media type)No. Fix the payload
Any 5xxMeta's sideYes

Don't retry a publish that might have succeeded. If media_publish times out, read the account's latest media before trying again, or you'll post twice.

When to use a scheduling API instead of building it yourself

The container flow is about 50 lines. The rest is what takes months: App Review, token refresh, JPEG conversion, carousel validation, publishing-limit tracking, retries that don't double-post, and the same work again for Facebook, Threads and YouTube. If Instagram is one of several networks you need, a scheduling API that already handles it is usually the cheaper path.

Tesselith's API publishes to Instagram (feed, carousels, Reels and Stories) through the same post model as every other live network, with idempotency keys and webhooks for publish results. Start with our scheduling API checklist, the automation walkthrough, or the docs.

Questions people ask

How do you publish to Instagram with the Graph API?
Create a media container with POST /<IG_ID>/media and a public media URL, poll the container until status_code is FINISHED, then call POST /<IG_ID>/media_publish with the container id as creation_id.
How many posts can you publish per day with the Instagram API?
Meta's rate-limit section allows 100 API-published posts per account in a rolling 24 hours, with a carousel counting as one. Check GET /<IG_ID>/content_publishing_limit for live usage.
Can the Instagram API post PNG images?
No. The Content Publishing API accepts JPEG only. Convert PNGs before creating the container.
How many images can an Instagram API carousel have?
Between 2 and 20 images, videos or a mix, per Meta's November 2026 documentation. All slides are cropped to the first image's aspect ratio.
Why does media_publish fail right after creating a container?
The container isn't FINISHED yet. Instagram processes media asynchronously, so poll the container's status_code before publishing.
Do I need a Facebook Page to use the Instagram API?
Not with the Instagram API with Instagram Login, which works with Business and Creator accounts directly. The Facebook Login version requires a linked Page.

Try Tesselith free

Connect your channels and schedule your first post in minutes. No credit card required.

Start free

Related pages

Schedule Instagram posts with TesselithTesselith REST APIHow to schedule Instagram ReelsThreads API publishingFacebook Graph API: post to a Page

More from the blog

X API Pricing in 2026: Pay-Per-Use Rates, What a Post Really Costs, and How to BudgetPosting to LinkedIn via API in 2026: the Posts API, Versioned Headers, Images, and Personal vs Company PagesPosting to a Facebook Page with the Graph API: Page Tokens, Photos, Video and SchedulingUploading Video with the YouTube Data API in 2026: Resumable Uploads, Quota Costs and the End of the Private Lock

Free to start

One calendar for everything you post.

No credit card. Connect your first channel and schedule a post in under two minutes.

Start free
Tesselith

The social scheduler for creators, teams and agencies. One calendar, every network you post to.

Product

  • Composer
  • Calendar
  • Analytics
  • Automation
  • AI assistant
  • Posting queue
  • API & webhooks
  • MCP server
  • All features

AI agents

  • Claude
  • Claude Code
  • ChatGPT
  • Codex
  • Cursor
  • Gemini CLI
  • n8n
  • All AI agents

Solutions

  • Creators
  • Agencies
  • Small business
  • E-commerce
  • All solutions

Compare

  • Scheduler pricing 2026
  • vs Buffer
  • vs Hootsuite
  • Metricool alternatives
  • Planoly alternatives
  • SocialBee alternatives
  • All comparisons
  • All alternatives

Free tools

  • Character counter
  • Best time to post
  • UTM builder
  • Engagement rate
  • All tools

Company

  • About
  • Blog
  • Research
  • Developer docs
  • Pricing
  • Contact
  • Security
  • Status

Legal

  • Privacy
  • Terms
  • Cookies
  • Acceptable Use
  • DPA
  • Refunds

Schedule posts for

  • X (Twitter)
  • Instagram
  • Facebook Pages
  • LinkedIn
  • YouTube
  • TikTok
  • Threads
  • Bluesky
  • Mastodon
  • Pinterest
  • Reddit
  • Discord
  • Telegram
  • Dev.to
  • Hashnode

Popular guides

  • Post to all social media at once
  • Schedule Discord messages
  • Cross-post to Bluesky, Mastodon and Threads
  • Buffer pricing
  • Sprout Social pricing
  • Metricool pricing
  • Sendible pricing
  • Loomly pricing
© 2026 Tesselith. All rights reserved.
PrivacyTermsCookiesSecurityData deletion
Tesselith