Facebook Pixel
APICreating Posts

Image carousel

Post 2–9 images as a swipeable LinkedIn carousel. Upload each image, then create one post referencing all of them.

A carousel is multiple images in one post. You upload each image (init + PUT), then create a single post with all the assetUrns in an assetUrns array.

When to use

You have 2 to 9 images to post together. For a single image, use Image post.

Steps

  1. For each image: POST /posts/upload/initPUT the bytes (same as a single image).
  2. Collect every assetUrn.
  3. POST /posts/create once, with mediaType: "image" and an assetUrns array (2–9 entries).
Carousel post (full flow)
# Repeat steps 1 + 2 for EACH image:
# 1. init -> assetUrn, uploadUrl
curl -X POST https://api.connectsafely.ai/linkedin/posts/upload/init -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{ "mediaType": "image", "fileSize": 184230, "filename": "slide-1.jpg" }'
# 2. upload the bytes
curl -X PUT "PASTE_uploadUrl" -H "Content-Type: image/jpeg" --data-binary @slide-1.jpg
# 3. create ONE post with all the collected assetUrns (2-9)
curl -X POST https://api.connectsafely.ai/linkedin/posts/create -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{ "mediaType": "image", "assetUrns": [{ "assetUrn": "URN_1" }, { "assetUrn": "URN_2" }], "text": "Our 2026 roadmap, one slide at a time." }'

Common mistakes

  • Only one image. A single entry isn't a carousel — use Image post with assetUrn instead.
  • More than 9 images. LinkedIn caps carousels at 9.
  • Mixing assetUrn and assetUrns. For a carousel, send assetUrns only.

Reference