Facebook Pixel
APILinkedIn Posts

Create a LinkedIn post

Publishes a LinkedIn post. The mediaType field decides what you post. Text (none): send text only, one call with no upload. Image (image): upload via /posts/upload/init, then pass assetUrn (and optional altText). Carousel (image): upload each image, then pass 2 to 9 of them in assetUrns. Video (video): upload, then pass assetUrn and recipes. Document/PDF (document): upload, poll /posts/upload/document-status until READY, then pass assetUrn, recipes, and title. New to the API? The step-by-step guide with cURL, JavaScript, and Python examples for each post type lives at /docs/api/posting.

POST/posts/create
Authentication requiredPosts

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/posts/create' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"text":"Try ConnectSafely.AI Today","title":"Our 2026 Product Roadmap"}'

Publishes a LinkedIn post. The mediaType field decides what you post. Text (none): send text only, one call with no upload. Image (image): upload via /posts/upload/init, then pass assetUrn (and optional altText). Carousel (image): upload each image, then pass 2 to 9 of them in assetUrns. Video (video): upload, then pass assetUrn and recipes. Document/PDF (document): upload, poll /posts/upload/document-status until READY, then pass assetUrn, recipes, and title. New to the API? The step-by-step guide with cURL, JavaScript, and Python examples for each post type lives at /docs/api/posting.

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoWhich connected account posts. Omit to use the default account.
textstringYesThe post body (max 3,000 characters).
visibilitystringNoWho can see the post.
mediaTypestringNoWhat you are posting. Use "image" for a carousel too (with assetUrns).
assetUrnstringNoSingle uploaded asset from /posts/upload/init. Required for image / video / document (a single image, video, or PDF).
assetUrnsarrayNoCarousel only: 2–9 uploaded images. Each item is { assetUrn, altText? }. Use instead of assetUrn with mediaType "image".
recipesarrayNoFrom /posts/upload/init. Required for video and document.
altTextstringNoAccessibility alt text for a single image (mediaType "image").
titlestringNoDocument title shown on the post (mediaType "document").

Example

{
  "text": "Try ConnectSafely.AI Today",
  "title": "Our 2026 Product Roadmap"
}

Responses

StatusDescription
200Post created
400Bad request
401Unauthorized
500Server error

200 Response Parameters

NameTypeDescription
successboolean
postUrnstring
shareUrnstring
accountIdstring

200 Example

{
  "success": true,
  "postUrn": "urn:li:share:7012345678901234567",
  "shareUrn": "urn:li:example:123456",
  "accountId": "acc_12345"
}

400 Response Parameters

NameTypeDescription
errorstring

400 Example

{
  "error": "example_value"
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "example_value"
}

500 Response Parameters

NameTypeDescription
errorstring

500 Example

{
  "error": "example_value"
}