How to Schedule Instagram Posts with an API (2026 Guide)


Scheduling Instagram posts via API sounds simple. Hit an endpoint, pass an image URL and a caption, set a time. Done.
Then you start reading the documentation. You need a Facebook Business account linked to a Facebook Page linked to an Instagram Professional account. You need Facebook OAuth 2.0 tokens that expire every 60 days. You need to create a media container, wait for it to process, then publish it in a separate request. And the Content Publishing API has rate limits that will throttle you at 25 posts per 24-hour window.
This guide covers two approaches: doing it the hard way with Instagram's native Graph API, and doing it the fast way with a unified scheduling API. Both work. One takes significantly less code and maintenance.
Table of Contents
- Option 1: Instagram Graph API (Native)
- Option 2: PostEverywhere API (Unified)
- Native vs Unified: Side-by-Side Comparison
- Common Use Cases
- Handling Media Uploads
- Error Handling and Debugging
- FAQs
- Wrapping Up
Option 1: Instagram Graph API (Native)
Instagram does not have its own standalone API for publishing. Everything goes through the Meta Graph API, specifically the Instagram Content Publishing API. If you have built against Facebook's APIs before, the flow will feel familiar. If you have not, prepare for a few layers of indirection.
Prerequisites
Before you can make a single API call, you need all of the following in place:
- A Facebook Business account — personal Facebook accounts will not work
- A Facebook Page linked to your business
- An Instagram Professional account (Business or Creator) connected to that Facebook Page
- A registered Meta App with the
instagram_basic,instagram_content_publish, andpages_read_engagementpermissions - App Review — if your app will be used by accounts other than your own, you must submit for Meta App Review
This is a non-trivial setup. If you are building an internal tool that only manages your own Instagram accounts, you can skip App Review and use your own access token. But if you are building a SaaS product or agency tool, you need to go through the full review process, which can take days or weeks.
Authentication: OAuth 2.0 and Token Management
Instagram API access requires a Facebook User Access Token with the right permissions. Here is the flow:
- Get a short-lived token — redirect the user through Facebook Login, which returns a token valid for about 1 hour
- Exchange for a long-lived token — call the
/oauth/access_tokenendpoint to get a token valid for 60 days - Refresh before expiry — long-lived tokens can be refreshed, but only if they have not already expired. You need a cron job or background worker to handle this
# Exchange short-lived token for a long-lived token
curl -X GET "https://graph.facebook.com/v21.0/oauth/access_token\
?grant_type=fb_exchange_token\
&client_id=YOUR_APP_ID\
&client_secret=YOUR_APP_SECRET\
&fb_exchange_token=SHORT_LIVED_TOKEN"
If the token expires and you do not refresh it in time, every scheduled publish in your queue will fail silently. You need to build monitoring around this. It is one of the most common failure modes in Instagram API integrations.
Step 1: Create a Media Container
Instagram's publishing flow is a two-step process. First, you create a media container — this tells Instagram to fetch your image or video from a publicly accessible URL and prepare it for publishing.
# Create a media container for a single image post
curl -X POST "https://graph.facebook.com/v21.0/INSTAGRAM_ACCOUNT_ID/media" \
-d "image_url=https://example.com/photo.jpg" \
-d "caption=New product launch! Check the link in bio. #launch #product" \
-d "access_token=YOUR_LONG_LIVED_TOKEN"
This returns a creation_id. The media is not published yet. Instagram is downloading your image, running it through their processing pipeline, and validating it against their content policies. For images, this usually takes a few seconds. For video, it can take significantly longer.
You need to poll the container status before publishing:
# Check if the container is ready
curl -X GET "https://graph.facebook.com/v21.0/CONTAINER_ID\
?fields=status_code\
&access_token=YOUR_LONG_LIVED_TOKEN"
Wait until status_code returns FINISHED before proceeding.
Step 2: Publish the Container
Once the container is ready, you publish it with a second API call:
# Publish the container
curl -X POST "https://graph.facebook.com/v21.0/INSTAGRAM_ACCOUNT_ID/media_publish" \
-d "creation_id=CONTAINER_ID" \
-d "access_token=YOUR_LONG_LIVED_TOKEN"
That is two HTTP requests minimum for a single image post, plus polling requests to check container status. For a carousel, it is even more — you create a container for each image, then create a parent carousel container referencing all child containers, then publish the parent.
Scheduling for a Future Time
To schedule a post instead of publishing immediately, you add the published and scheduled_publish_time parameters to the container creation step:
# Create a scheduled media container
curl -X POST "https://graph.facebook.com/v21.0/INSTAGRAM_ACCOUNT_ID/media" \
-d "image_url=https://example.com/photo.jpg" \
-d "caption=Launching tomorrow! Stay tuned. #comingsoon" \
-d "published=false" \
-d "scheduled_publish_time=1718280000" \
-d "access_token=YOUR_LONG_LIVED_TOKEN"
The scheduled_publish_time is a Unix timestamp. It must be between 10 minutes and 75 days in the future. Once created, the container sits in a scheduled state and Instagram publishes it at the specified time. You do not need to make the publish call — Meta handles it server-side.
Rate Limits
The Instagram Content Publishing API enforces strict rate limits:
- 25 published posts per 24-hour rolling window per Instagram account
- 50 media containers can exist in an unpublished state at any time
- 200 API calls per hour per user token (shared across all Graph API endpoints)
If you are managing multiple accounts, each account has its own 25-post limit. But the 200-call-per-hour limit applies to the token, not the account — so if you are using one token to manage 10 accounts, all 10 share that 200-call budget.
For bulk scheduling workflows, this means you need to carefully batch your requests and implement retry logic with exponential backoff.
Limitations
Even in 2026, the native Instagram API has gaps:
- Reels scheduling was added relatively recently, but error handling around video processing remains inconsistent
- Stories cannot be scheduled through the Content Publishing API — they require the Instagram Stories API, which has a different flow entirely
- Carousel posts require creating individual containers for each media item, then wrapping them in a parent container — adding 3-10 extra API calls per post
- No webhook for publish confirmation — you need to poll for status
- Token management is your responsibility — build it, monitor it, or watch posts fail
If you are building anything beyond a simple "post one image" integration, the native API surface area is substantial. Which is why many developers look for an abstraction layer.
Option 2: PostEverywhere API (Unified)
The PostEverywhere API takes a different approach. Instead of wrapping Instagram's native API and exposing the same complexity, it abstracts it entirely. You send one request with your content, target accounts, and schedule time. PostEverywhere handles the container creation, media processing, token management, and publishing.
Authentication
No OAuth dance. No app registration. No token rotation cron jobs.
You get a Bearer token from your developer settings. Include it in the Authorization header. It does not expire unless you revoke it.
Schedule an Instagram Post
Here is the equivalent of everything we just did above — container creation, scheduling, and publishing — in a single request:
curl -X POST "https://app.posteverywhere.ai/api/v1/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "New product launch! Check the link in bio. #launch #product",
"platforms": ["instagram"],
"media_urls": ["https://example.com/photo.jpg"],
"scheduled_for": "2026-06-13T14:00:00Z"
}'
Five lines. No container IDs. No polling. No token refresh. The response includes a post_id you can use to check status, update, or delete the scheduled post.
And because it is a unified API, you can add more platforms in the same request:
curl -X POST "https://app.posteverywhere.ai/api/v1/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "New product launch! Check the link in bio.",
"platforms": ["instagram", "facebook", "linkedin", "x", "threads"],
"media_urls": ["https://example.com/photo.jpg"],
"scheduled_for": "2026-06-13T14:00:00Z"
}'
Same content, five platforms, one HTTP request. The API handles cross-posting format requirements automatically — resizing images, adjusting character limits, stripping unsupported formatting.
What PostEverywhere Handles Behind the Scenes
When you send a scheduling request, the API takes care of:
- Token refresh — PostEverywhere maintains and rotates OAuth tokens for all connected Instagram accounts. You never see a token.
- Media processing — images and videos are downloaded, validated, resized to platform specs, and uploaded in the correct format
- Container orchestration — the two-step create-then-publish flow happens server-side
- Rate limit management — requests are queued intelligently to stay within Instagram's 25-post and 200-call limits
- Retry logic — transient failures get retried with backoff. Permanent failures trigger webhook notifications.
- Webhook callbacks — get notified when a post publishes successfully or fails, without polling
You can read the full API documentation for endpoint details, error codes, and advanced features like AI content generation and optimal time scheduling.
Building an Instagram integration? The PostEverywhere API handles Instagram's OAuth tokens, media containers, and rate limits so you can focus on your product. Get started with a free trial — no credit card required.
Native vs Unified: Side-by-Side Comparison
Here is how the two approaches compare across the dimensions that matter for production use:
| Factor | Instagram Graph API | PostEverywhere API |
|---|---|---|
| Auth setup | Facebook OAuth 2.0 + App Review | Bearer token |
| Token management | Manual refresh every 60 days | Handled automatically |
| Requests per post | 2-3 (create container, poll, publish) | 1 |
| Lines of code (basic post) | 40-60 | 8-12 |
| Scheduling support | Yes (Unix timestamp) | Yes (ISO 8601) |
| Reels support | Yes (with video processing delays) | Yes |
| Stories support | Limited (separate API) | Yes |
| Carousel support | Yes (3-10 extra requests) | Yes (single request) |
| Rate limits | 25 posts/24hrs, 200 calls/hr | Managed for you |
| Multi-platform | Instagram only | 8 platforms, one endpoint |
| Media processing | You handle resizing and validation | Automatic |
| Webhooks | No (polling only) | Yes |
| Maintenance burden | High — token refresh, API version migration, error handling | Low — maintained by PostEverywhere |
| Cost | Free (API access) | Starts at $19/month |
If you only need Instagram, only manage one account, and do not mind building and maintaining the token refresh and container orchestration logic, the native API is free and fully capable. For everyone else — multi-account, multi-platform, or shipping fast — a unified API saves weeks of development time.
Common Use Cases
Bulk Scheduling from a CSV or Database
The most common integration pattern. You have a spreadsheet, a CMS, or a database table of posts with captions, image URLs, and publish times. A script reads each row and sends a scheduling request.
With the native API, you need to handle container creation sequentially (rate limits) and track each container's processing status. With the PostEverywhere API, it is a loop of POST requests — the API queues everything internally.
This pattern works well for:
- Monthly content calendars prepared by marketing teams
- E-commerce product launches with dozens of posts
- Event-driven content like conference schedules or sale announcements
CMS and Headless CMS Integration
Connect your blog or content platform to Instagram. When a new article publishes, automatically create an Instagram post with the featured image and a teaser caption.
Popular setups include:
- WordPress — trigger on
publish_posthook, call the scheduling API - Sanity/Contentful/Strapi — use webhooks to trigger a serverless function that sends the API request
- Ghost — custom integration via their webhook system
The key advantage of a unified API here is that a single webhook handler distributes content to every social platform. You do not need a separate integration for Instagram, another for LinkedIn, another for X. One handler, one API call, all platforms. See the social media scheduling API guide for the full architecture pattern.
E-Commerce Product Posts
Shopify, WooCommerce, and other e-commerce platforms can trigger Instagram posts when new products are added or inventory changes. Common patterns:
- New product added — auto-generate an Instagram post with the product image, name, and price
- Back in stock — schedule a post announcing restocked items
- Flash sales — bulk schedule promotional posts across multiple time zones
Pair this with PostEverywhere's AI content generator to automatically write captions from product metadata, and you have a fully automated social media pipeline.
AI Agent Workflows
LLM-powered content agents are increasingly common. The workflow looks like this:
- An AI agent generates post content (text + image prompt)
- The agent calls an image generation API
- The agent calls a scheduling API to publish across platforms
For step 3, you need an API that is easy to call from agent frameworks like LangChain, CrewAI, or custom orchestrators. A Bearer-token API with a single endpoint is far more practical for agent integrations than Facebook OAuth flows. See the social media scheduling API hub for more on this pattern.
Automated Reporting and Republishing
Pull analytics for your top-performing Instagram posts, then automatically reschedule them for the following week or cross-post them to other platforms. This is a common pattern for agencies managing multiple client accounts where evergreen content gets recycled.
Need to schedule Instagram posts from your app or API? PostEverywhere gives you one endpoint for Instagram, TikTok, LinkedIn, Facebook, X, YouTube, and Threads. Explore the API docs and start shipping today.
Handling Media Uploads
Instagram is a visual-first platform, so every post needs media. Here is what you need to know about uploading images and video through both API approaches.
Native API Media Requirements
The Instagram Graph API requires your media to be hosted at a publicly accessible URL. Instagram's servers fetch the media from that URL during container creation. This means:
- The image must be reachable from Meta's servers (no localhost, no private networks)
- Supported formats: JPEG and PNG for images, MP4 for video
- Maximum image file size: 8MB
- Maximum video file size: 100MB (Reels), 100MB (feed videos)
- Aspect ratios: 1:1 (square), 4:5 (portrait), 1.91:1 (landscape) for feed posts
If your media lives behind authentication or in cloud storage with expiring URLs, you need to either generate a temporary public URL or upload to a public CDN first.
Unified API Media Handling
The PostEverywhere API accepts media URLs in the request body and handles all processing server-side:
- Automatic format validation — rejects unsupported formats before queuing
- Automatic resizing — images are resized to platform-optimal dimensions
- Aspect ratio optimization — content is cropped or padded to match Instagram's supported ratios
- Video transcoding — videos are re-encoded if needed to meet Instagram's codec requirements
You send the URL. The API does the rest.
Error Handling and Debugging
Common Native API Errors
Building against the Instagram Graph API, you will encounter these frequently:
- OAuthException (code 190) — expired or invalid access token. Most common cause of production failures. Fix: implement proactive token refresh.
- Application request limit reached (code 4) — you have exceeded the 200 calls/hour rate limit. Fix: implement request queuing with backoff.
- Media not available (code 2207026) — Instagram could not download your media from the provided URL. Fix: ensure the URL is publicly accessible and the file is under size limits.
- Permissions error (code 10) — the token does not have the required permissions. Fix: re-authenticate with the correct scope.
Debugging Tips
When something fails, check these in order:
- Token validity — call
/me?access_token=TOKENto verify the token is still active - Account connection — verify the Instagram account is still linked to the Facebook Page
- Media accessibility — try downloading the media URL in an incognito browser window
- Rate limit status — check
x-app-usageresponse headers for current utilization - Container status — if a container is stuck, check for
status_code: ERRORwith astatusfield describing the issue
With the PostEverywhere API, most of these are handled automatically. Failed posts trigger webhook notifications with detailed error messages and suggested fixes. You can also check post status via the GET /posts/{id} endpoint.
FAQs
Can I schedule Instagram Reels through the API?
Yes. Both the native Instagram Graph API and the PostEverywhere API support scheduling Reels. With the native API, you set media_type=REELS and provide a video_url in the container creation request. Processing time for video can be longer, so you need to poll the container status more aggressively. With PostEverywhere, you include the video URL and the API detects and handles the Reels format automatically.
Can I schedule Instagram Stories through an API?
The native Instagram Content Publishing API does not support scheduling Stories. Stories require the separate Instagram Stories API, which has a different set of endpoints and limitations. PostEverywhere supports scheduling Stories through the same unified endpoint — add "post_type": "story" to your request body.
What happens if my Instagram token expires mid-schedule?
With the native Graph API, any posts queued for publishing after your token expires will fail. You need to implement token refresh logic that runs before expiry — typically as a cron job every 30-50 days. With PostEverywhere, token refresh is handled entirely server-side. You never manage Instagram OAuth tokens directly.
Is the Instagram API free to use?
Yes, the Instagram Graph API is free. There are no per-request charges from Meta. However, you need to factor in the development time to build and maintain the integration — token management, container orchestration, error handling, rate limit logic. PostEverywhere starts at $19/month with a 7-day free trial and no credit card required.
How do I schedule carousel posts via the API?
With the native API, carousels require creating individual media containers for each image or video (up to 10 items), then creating a parent carousel container that references all child containers by their IDs, then publishing the parent. That is 12 API calls for a 10-image carousel. With PostEverywhere, you pass an array of media URLs in a single request — the API handles the rest.
Can I schedule Instagram posts to multiple accounts at once?
Yes. With the native API, you need to make separate container creation and publish requests for each Instagram account, using each account's specific access token. With PostEverywhere, you pass multiple account_ids in a single request and the API distributes the post to all of them.
What are the rate limits for scheduling Instagram posts?
The native API limits you to 25 published posts per 24-hour rolling window per Instagram account, with 200 API calls per hour per user token. PostEverywhere manages rate limits internally — you send requests and the API queues them to stay within Instagram's limits automatically.
Can I edit or delete a scheduled Instagram post via the API?
With the native Graph API, you cannot edit a scheduled container. You must delete it and create a new one. With PostEverywhere, you can update the content, media, or schedule time of a pending post via a PATCH request to /posts/{id}, or delete it via a DELETE request.
Wrapping Up
Scheduling Instagram posts via API is straightforward in concept and complex in practice. The native Instagram Graph API gives you full control but requires significant investment in OAuth management, container orchestration, media processing, and rate limit handling. For a single-account, Instagram-only use case, it works.
For anything beyond that — multiple accounts, multiple platforms, production reliability, or shipping on a deadline — a unified API removes the complexity and lets you focus on your product instead of Instagram's infrastructure quirks.
If you are already scheduling Instagram posts manually and want to add API automation, or if you are evaluating Instagram schedulers for a development workflow, the PostEverywhere API is the fastest path from zero to production.
Check out the full API documentation to get started, or read the social media scheduling API guide for a comprehensive look at scheduling APIs across all platforms.

Founder & CEO of PostEverywhere. Writing about social media strategy, publishing workflows, and analytics that help brands grow faster.