Skip to main content

Media API

Media endpoints manage the workspace media library. Each saved item has an id you can reference when you create or update a post, or in comment media. All routes require the posts ability (same token scope as post CRUD).

Using media on posts

In content[].media, each element may be either:
  • Integer - library id from list, get, upload/file, or upload/url (must belong to the same workspace_id as the post).
  • String (URL) - public HTTPS link to an image, video, or document; the API validates and processes it when the post is saved.
You can mix ids and URLs in the same media array.

Supported file types

Documents

A document attachment becomes a LinkedIn document post (the swipeable carousel). Two rules apply when publishing:
  • LinkedIn accepts one document per post. If you attach several, only the first is published.
  • The document must be the first item in content[].media. PostSyncer decides the post type from the first attachment, so a document listed after an image or video is dropped - LinkedIn cannot mix documents with other media.
Other platforms in the same post ignore document attachments and publish the text (plus any image/video they do support). Documents are not accepted in comment media - comments remain image and video only. Typical flows:
  1. File on disk → POST /media/upload/file with the file → read media.id → include that id in POST /posts … content[].media.
  2. Already on the web → either paste the URL directly in content[].media, or call POST /media/upload/url first to store a copy in the library and then use the returned id.
  3. Browse library → GET /media?workspace_id=… to discover ids.

Limits and infrastructure

  • File upload is limited to 500MB per request.
  • URL import may return multiple media objects for a single input URL (e.g. some social posts). Check count_stored and each item’s id.

Folders

Create and list folders with Folders API, then pass folder_id on upload endpoints to file media into the right library folder. Use folder_id or root_only on List media to scope results.

See also

List media

Folders

Upload from file

Import from URL

Create post