Media API
Media endpoints manage the workspace media library. Each saved item has anid 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
Incontent[].media, each element may be either:
- Integer - library
idfrom list, get,upload/file, orupload/url(must belong to the sameworkspace_idas the post). - String (URL) - public HTTPS link to an image, video, or document; the API validates and processes it when the post is saved.
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.
media - comments remain image and video only.
Typical flows:
- File on disk →
POST /media/upload/filewith the file → readmedia.id→ include that id inPOST /posts…content[].media. - Already on the web → either paste the URL directly in
content[].media, or callPOST /media/upload/urlfirst to store a copy in the library and then use the returnedid. - 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
mediaobjects for a single input URL (e.g. some social posts). Checkcount_storedand each item’sid.
Folders
Create and list folders with Folders API, then passfolder_id on upload endpoints to file media into the right library folder. Use folder_id or root_only on List media to scope results.