Schedule Instagram Posts via API — Developer Guide
How to schedule Instagram posts programmatically using the Content Publishing API. Authentication, endpoints, code examples, and rate limits.
Published March 29, 2026
Run your social from ChatGPT & Claude. Replypine speaks MCP — connect it to your AI assistant and automate by chat.
See how it worksThe Instagram Graph API lets you schedule posts programmatically. This guide covers authentication, the Content Publishing API endpoints, rate limits, and a working Node.js example.
Prerequisites
Before you can schedule via API, you need:
- An Instagram Business or Creator account
- A Facebook Page linked to the Instagram account
- A Meta Developer App with Instagram permissions
- An access token with
instagram_basic,instagram_content_publish, andpages_show_listpermissions
If you do not want to build this yourself, SociaHive's API wraps all of this with a simpler interface and handles token management for you.
The Content Publishing API
Instagram uses a two-step process to publish content:
Step 1: Create a media container
POST https://graph.facebook.com/v19.0/{ig-user-id}/mediaParameters:
image_urlorvideo_url— publicly accessible URL of the mediacaption— your post captionpublish— set tofalsefor schedulingscheduled_publish_time— Unix timestamp (10 minutes to 75 days from now)
For scheduled posts, skip this step. The container publishes automatically at the scheduled time.
For immediate publish:
POST https://graph.facebook.com/v19.0/{ig-user-id}/media_publishParameters:
creation_id— the container ID from step 1
Scheduling a Post (Node.js Example)
const GRAPH_API = 'https://graph.facebook.com/v19.0';async function schedulePost(userId, accessToken, imageUrl, caption, publishTime) {
// Step 1: Create container with scheduled time
const containerRes = await fetch(${GRAPH_API}/${userId}/media, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
image_url: imageUrl,
caption: caption,
scheduled_publish_time: Math.floor(publishTime.getTime() / 1000),
access_token: accessToken,
}),
});
const container = await containerRes.json();
console.log('Scheduled container:', container.id);
return container.id;
}
Scheduling a Carousel
Carousels require creating child containers first, then a parent container:
- Create individual containers for each image/video (up to 10)
- Create a parent carousel container with
childrenparameter listing the child IDs - Set
scheduled_publish_timeon the parent container
Rate Limits
Instagram enforces these limits per account:
- 50 API-published posts per 24 hours (includes scheduled and immediate)
- Scheduling window: 10 minutes to 75 days in the future
- Container creation: 50 per hour per account
- General API rate: 200 calls per user per hour
Exceeding these limits returns error code 4 (rate limit) or 32 (page request limit).
Error Handling
Common errors when scheduling:
| Error Code | Meaning | Fix |
|---|---|---|
| 9 | Permission denied | Check app permissions and access token |
| 36003 | Media URL not accessible | Ensure image/video URL is publicly accessible |
| 2207026 | Scheduled time invalid | Must be 10min to 75 days from now |
| 190 | Access token expired | Refresh the token |
Using SociaHive API Instead
If you do not want to manage Meta API authentication, token refresh, and error handling yourself, SociaHive's MCP server and API provides a simpler interface:
- Handles OAuth and token refresh automatically
- Supports all 9 scheduling platforms from one API
- Visual flow builder for non-developers
- Built-in retry logic and error recovery
Frequently Asked Questions
Is the Instagram Content Publishing API free?
Yes. Meta does not charge for API access. Your costs come from hosting your application and the scheduling tool you use.
Can I schedule Reels through the API?
Yes. Use media_type: 'REELS' and video_url instead of image_url. Licensed music from Instagram's library is not available through the API.
How do I get an Instagram API access token?
Create a Meta Developer App, add Instagram permissions, and authenticate through the OAuth flow. The process takes 30-60 minutes for initial setup.
Free tools for this
No signup needed for most — try them right now.
Best Time to Post on Instagram
Find the optimal posting times for your niche and audience.
Open toolAI Content Calendar Generator
Generate a 7-day content calendar with topics, hashtags, and CTA keywords.
Open toolSocial Media Holiday Calendar
Never miss a content opportunity — key social media holidays with content ideas.
Open toolKeep reading

Run your social from ChatGPT & Claude
Replypine speaks MCP — connect it to your AI assistant and automate by chat.