Instagram API: how to post to Instagram programmatically
The Instagram Graph API lets you publish posts to a Business or Creator account, but it comes with an app-review process, a two-step container flow, and rate limits to design around. Here's what the raw API actually requires — and a unified API that skips the setup.
What you need before you can call the Instagram Graph API
- An Instagram account converted to a Business or Creator account
- That account linked to a Facebook Page you admin
- A Meta developer app with the instagram_content_publish (Facebook Login) or instagram_business_content_publish (Instagram Login) permission
- Meta App Review approval before you can publish for accounts you don't own
- Media hosted at a public URL — the Graph API pulls from a URL, you can't upload a local file directly
The publish flow: container, then publish
Instagram doesn't publish in one request — you create a media container, wait for Meta to process it, then publish that container.
Create a media container
POST to /{ig-user-id}/media with image_url (or video_url), caption, and media_type. Meta processes the media asynchronously and hands back a container ID.
Poll until the container is ready
GET /{container-id}?fields=status_code until status_code is FINISHED. Video containers can take anywhere from a few seconds to a couple of minutes.
Publish the container
POST to /{ig-user-id}/media_publish with the creation_id. Only now does the post actually appear on Instagram.
Skip the app review: post via SocialDock's API instead
SocialDock has already been through Meta's App Review process. Connect an Instagram account through the hosted OAuth flow, then publish with one request — no container polling, no separate app per platform.
curl -X POST https://www.socialdock.dev/api/v1/posts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Shipped a new feature today 🚀",
"targets": [
{ "platform": "instagram", "account_id": "acc_01hx..." }
],
"media_urls": ["https://cdn.example.com/launch.jpg"],
"scheduled_at": "2026-08-01T18:00:00Z"
}'- Single/video image posts and carousels (up to 10 items, 2,200-character captions, video up to 100MB) work today.
- Reels and Stories scheduling aren't supported yet — if that's your main use case, the raw Graph API is still your only option today.