# How to Automate Instagram Reels Scheduling using the API

- Tool: API Automations
- Difficulty: Intermediate
- Fix time: 30-60 minutes
- Compatibility: Instagram Business or Creator account required; Facebook Page linked; instagram_business_content_publish scope requires Meta App Review (2-4 weeks)
- Last updated: May 2026

## TL;DR

Schedule Instagram Reels via the Graph API using the same two-step container model as feed posts, but with media_type=REELS and video_url instead of image_url. Video processing takes 30 seconds to several minutes, so you must poll the container status until FINISHED before calling media_publish. API-published Reels are capped at 90 seconds; only MP4/MOV with H.264 codec work — other formats silently fail with error code 24.

## Best practices

- Always pre-validate video with ffprobe before creating a container — H.264 codec and AAC audio are non-negotiable, and format errors return unhelpful error code 24
- Keep API-published Reels under 90 seconds — longer videos must be trimmed since the API hard-caps at 90s even though the native app supports 3+ minutes
- Use a cover_url thumbnail — Reels without a specified cover use the first frame, which is often a loading screen or awkward freeze frame
- Poll status with a minimum 10-second interval using exponential backoff — polling too fast burns your 200 calls/hour quota without speeding up processing
- Create containers only at publish time (2-5 minutes before target) — storing containers days ahead will result in expiry errors
- Implement idempotency: store container_id per scheduled Reel so a crashed worker doesn't create duplicate containers on restart
- Track the media_id of published Reels in your database to enable later analytics queries and content performance reporting

## Frequently asked questions

### Why are my Reels publishing as private (visible only to me)?

This is most likely a permissions issue. Ensure your app has the instagram_business_content_publish permission approved via Meta App Review. In Development mode, only test users (added via App Dashboard > Roles > Test Users) can publish successfully. The video also needs to be from a Business or Creator account — personal accounts cannot use the API.

### What is the maximum Reel duration via API?

90 seconds via the Instagram Graph API. The native Instagram app supports Reels up to 3+ minutes, but the API strictly enforces the 90-second cap. Your automation should trim or reject videos longer than 90 seconds before creating the container. Use ffmpeg: `ffmpeg -i input.mp4 -t 90 output.mp4`.

### What happens when I hit the rate limit during video polling?

You'll get HTTP 400 with error code 17. The 200 calls/hour quota is shared across all API operations for that user+app pair — not just polling. If your polling loop consumes most of the 200 calls, you'll have fewer left for other operations. Use exponential backoff starting at 10 seconds, and monitor the X-Business-Use-Case-Usage header. When the call_count percentage exceeds 80%, increase your polling interval.

### Why does my video fail with error code 24?

Error code 24 means your video format or aspect ratio is rejected. Check: (1) container format must be MP4 or MOV — not MKV, AVI, or WebM; (2) video codec must be H.264 — not H.265/HEVC or VP9; (3) audio codec must be AAC — not MP3 or Opus; (4) frame rate must be 23-60 FPS. Run `ffprobe -v quiet -show_streams video.mp4` to inspect your video's actual codecs, then re-encode with `ffmpeg -c:v libx264 -c:a aac`.

### Can I schedule Reels more than 24 hours ahead of time?

Not by pre-creating containers — they expire in exactly 24 hours. Instead, store your scheduling data (video URL, caption, cover image URL, target publish time) in your own database. Your cron job creates the container only at publish time, typically 3-5 minutes before the target timestamp. This is the correct scheduling pattern for the Instagram Graph API.

### Is the Instagram Graph API free for Reels publishing?

Yes — the API is free with no per-request charges from Meta. You need a Meta developer account (free), a Facebook App (free), and the instagram_business_content_publish permission approved via App Review (free but takes 2-4 weeks). The account publishing the Reels must be an Instagram Business or Creator account, not a personal account.

### Can RapidDev help build a Reels scheduling system?

Yes — RapidDev has built video publishing automation for content teams and agencies. We handle the Meta App setup and App Review process, video validation pipeline, scheduling database, and production monitoring. Book a free consultation at rapidevelopers.com.

### How do I add music or audio to Reels published via API?

You cannot add Instagram's native music library to Reels via API — that feature is only available in the native Instagram app. Via API, the audio must be included in the video file itself. If you need licensed music, embed it in the video before uploading. Be aware of copyright: Instagram may automatically mute videos with copyrighted audio even when published via API.

---

Source: https://www.rapidevelopers.com/api-automations/how-to-automate-instagram-reels-scheduling-using-the-api
© RapidDev — https://www.rapidevelopers.com/api-automations/how-to-automate-instagram-reels-scheduling-using-the-api
