Instagram API Guide

How to Schedule Instagram Carousels via API

Create multi-image carousel posts on Instagram using the PostFast API. Schedule up to 10 images in a single swipeable post.

Last updated: January 2025
Automate your Instagram carousel strategyGet API Key

Instagram carousels are multi-image posts that users can swipe through, making them perfect for tutorials, product showcases, before/after comparisons, and storytelling. Carousels consistently outperform single-image posts in engagement.

To create a carousel, include 2-10 IMAGE items in your mediaItems array with sequential sortOrder values. Set instagramPublishType to "TIMELINE" (or omit it since TIMELINE is the default).

Instagram carousels support inviting collaborators to co-author the post, which can significantly expand reach by appearing on both profiles' feeds.

API Parameters

ParameterTypeDescription
instagramPublishTypestringType of Instagram post to create
TIMELINESTORYREEL
instagramPostToGridbooleanPost to profile grid (for Reels)
instagramCollaboratorsstring[]Array of Instagram usernames for collaboration

Code Example

const response = await fetch('https://api.postfa.st/social-posts', {
  method: 'POST',
  headers: {
    'pf-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
        "posts": [
            {
                "content": "The complete guide to building your morning routine (save this!)\n\nSlide 1: Wake up at the same time daily\nSlide 2: Hydrate before caffeine\nSlide 3: 10 min movement\nSlide 4: Review your priorities\nSlide 5: Start with your hardest task\n\nWhich tip are you trying tomorrow?\n\n#morningroutine #productivity #habits #selfimprovement",
                "mediaItems": [
                    {
                        "key": "image/ig1a2b3c-d4e5-6789-0123-456789abcdef.jpg",
                        "type": "IMAGE",
                        "sortOrder": 0
                    },
                    {
                        "key": "image/ig2b3c4d-e5f6-7890-1234-567890abcdef.jpg",
                        "type": "IMAGE",
                        "sortOrder": 1
                    },
                    {
                        "key": "image/ig3c4d5e-f6a7-8901-2345-67890abcdef1.jpg",
                        "type": "IMAGE",
                        "sortOrder": 2
                    },
                    {
                        "key": "image/ig4d5e6f-a7b8-9012-3456-7890abcdef12.jpg",
                        "type": "IMAGE",
                        "sortOrder": 3
                    },
                    {
                        "key": "image/ig5e6f7a-b8c9-0123-4567-890abcdef123.jpg",
                        "type": "IMAGE",
                        "sortOrder": 4
                    }
                ],
                "scheduledAt": "2025-01-31T10:00:00.000Z",
                "socialMediaId": "770fa600-04bd-43f6-c938-667877660003"
            }
        ],
        "controls": {
            "instagramPublishType": "TIMELINE",
            "instagramPostToGrid": true
        }
    })
});

const data = await response.json();

Did You Know?

Image Count
2-10 images
Minimum 2 images for carousel, maximum 10
Aspect Ratio
1:1 or 4:5
All images should use the same aspect ratio for best display
Caption
2,200 characters
Same limit as single-image posts
No Videos
Images only
Carousels cannot include videos - use Reels for video content

Tips

Use the first image as a strong hook - it determines whether users swipe

Maintain consistent visual style (colors, fonts, layout) across all slides

Number your slides or add 'swipe' indicators to encourage engagement

End with a clear call-to-action (follow, save, comment)

Portrait (4:5) carousels take up more screen space and typically perform better

Educational carousels and listicles consistently outperform single images

Schedule carousels, Reels, and Stories from one API

7-day free trial
Try PostFast Free

Common Pitfalls

Single image not a carousel

Including only 1 image creates a regular post, not a carousel. Include at least 2 images.

Mixed aspect ratios

Using different aspect ratios across slides causes awkward cropping. Use the same ratio for all images.

sortOrder gaps or duplicates

Ensure sortOrder values are sequential (0, 1, 2...). Gaps or duplicates may cause unexpected ordering.

Too many slides

More than 10 images will cause an error. If you need more, split into multiple carousel posts.

Frequently Asked Questions

What's the maximum number of images in an Instagram carousel?

Instagram carousels support 2-10 images. You need at least 2 images for it to be treated as a carousel.

Can I mix images and videos in an Instagram carousel?

No, Instagram carousels through the API only support images. For video content, use instagramPublishType: 'REEL' for short-form video.

How do I control the order of images?

Use the sortOrder field in each mediaItem. Set values starting from 0 in the order you want images to appear (0 = first slide, 1 = second, etc.).

Build engaging Instagram carousels with programmatic posting

Start Free Trial
7-day free trialCancel anytime