LinkedIn API Guide

How to Schedule LinkedIn Image Carousels via API

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

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

LinkedIn image carousels let you share multiple images in a single swipeable post, perfect for product showcases, team introductions, event highlights, and step-by-step guides. Carousels often outperform single-image posts in engagement.

To create an image carousel, include 2-9 IMAGE items in your mediaItems array with sequential sortOrder values. LinkedIn will automatically display them as a swipeable carousel.

Note: This guide covers image carousels. For document carousels (PDF, PowerPoint, Word files that display as swipeable slides), see our LinkedIn Documents guide which uses linkedinAttachmentKey instead of mediaItems.

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": "Meet the team behind our latest product launch:\n\nSlide 1: Engineering\nSlide 2: Design\nSlide 3: Marketing\nSlide 4: Customer Success\n\nEvery launch takes a village. Tag someone who made your last launch possible!\n\n#teamwork #productlaunch #startup",
                "mediaItems": [
                    {
                        "key": "image/a1b2c3d4-e5f6-7890-abcd-ef1234567890.jpg",
                        "type": "IMAGE",
                        "sortOrder": 0
                    },
                    {
                        "key": "image/b2c3d4e5-f6a7-8901-bcde-f12345678901.jpg",
                        "type": "IMAGE",
                        "sortOrder": 1
                    },
                    {
                        "key": "image/c3d4e5f6-a7b8-9012-cdef-012345678912.jpg",
                        "type": "IMAGE",
                        "sortOrder": 2
                    },
                    {
                        "key": "image/d4e5f6a7-b8c9-0123-def0-123456789023.jpg",
                        "type": "IMAGE",
                        "sortOrder": 3
                    }
                ],
                "scheduledAt": "2025-01-31T09:00:00.000Z",
                "socialMediaId": "bb1a3944-c8de-97f0-a372-001211005007"
            }
        ],
        "controls": {}
    })
});

const data = await response.json();

Did You Know?

Image Count
2-9 images
Minimum 2 images for carousel, maximum 9
Aspect Ratio
1:1 or 1.91:1
Square or landscape recommended for consistent display
Caption
3,000 characters
Same limit as regular LinkedIn posts
No Videos
Images only
Image carousels cannot include videos - post videos separately

Tips

Use the first image as a strong hook - it appears in the feed before users swipe

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

Square (1:1) images work well on both mobile and desktop

Reference slides in your caption to encourage swiping (e.g., 'See slide 3 for the results')

End with a call-to-action slide (follow, comment, visit website)

Carousels work great for listicles, tutorials, and before/after comparisons

Schedule image carousels, documents, and videos to LinkedIn via API

7-day free trial
Try PostFast Free

Common Pitfalls

Single image not a carousel

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

More than 9 images

LinkedIn image carousels support a maximum of 9 images. If you need more, consider using a document post or splitting into multiple posts.

sortOrder gaps or duplicates

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

Mixing with videos or documents

You cannot mix images with videos or documents in a single post. Choose one media type per post.

Frequently Asked Questions

What's the maximum number of images in a LinkedIn carousel?

LinkedIn image carousels support 2-9 images. You need at least 2 images for it to be treated as a carousel.

What's the difference between image carousels and document carousels?

Image carousels use mediaItems with IMAGE type (up to 9 images). Document carousels use linkedinAttachmentKey to upload a PDF/PPTX/DOCX file that displays as swipeable slides. Document carousels are better for text-heavy educational content.

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 LinkedIn carousels with programmatic posting

Start Free Trial
7-day free trialCancel anytime