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
- For each image:
POST /posts/upload/init→PUTthe bytes (same as a single image). - Collect every
assetUrn. POST /posts/createonce, withmediaType: "image"and anassetUrnsarray (2–9 entries).
Carousel post (full flow)
# Repeat steps 1 + 2 for EACH image:# 1. init -> assetUrn, uploadUrlcurl -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 bytescurl -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
assetUrninstead. - More than 9 images. LinkedIn caps carousels at 9.
- Mixing
assetUrnandassetUrns. For a carousel, sendassetUrnsonly.
