link field on each media object.
The media library endpoints are available on the Pro and Business plans. On a workspace whose owner is on Free they return 402.
Anatomy of a media item
Uploading
POST /workspaces/{workspace}/media_contents is the one way to add media. Give it a URL or a file:
- A URL: a JSON body with
url(plus optionalname,label,folder_id). Images of up to 50 MB come back ready:201with the itemactive. Videos, and files larger than 50 MB, come backprocessingwith202: pollGET /media_contents/{mediaContent}until the item isactiveorfailed. A URL that announces more than 2 GB is refused with413. - Files: a
multipart/form-databody with 1 to 10 files infiles[](plus optionallabelandfolder_id), up to 200 MB each. Every file is stored during the request:201with each itemactive. A larger file is refused with413.
- Presign:
POST /workspaces/{workspace}/media_contents/presignwith each file’sname,mime, andsize. You get back a pre-signedupload_url(and atemporarymediaid) for each file, up to 10 per request. - Upload:
PUTeach file’s bytes straight to itsupload_url, replaying the returnedupload_headers. - Confirm:
POST /workspaces/{workspace}/media_contents/confirmwith the IDs from step 1 asmedia_ids. The API verifies each object, moves it into the library, and returns the finalized media objects. Confirming is all or nothing: if any file hasn’t been uploaded, nothing is confirmed and the response is a422naming those IDs.
Media status
Every media response carriesstatus, and error_message when an import failed:
A post that references a
processing or failed item gets a 422 that names the item and tells you to poll it or to import it again.
Folders
Folders are an organisational layer on top of the library, purely for your team, and never visible to the social network. A folder has anid, a name, a parent_id (so folders nest; null at the top level), and an is_system flag. System folders are created by PublishBuddy and cannot be renamed or deleted; trying either returns 422.
Files with no folder live at the root of the library.
Filtering and listing
GET /workspaces/{workspace}/media_contents supports:
folder_id: a folder UUID to list one folder, orrootfor files that are not in any folder. Omit it to list everything.status:active(the default),processing,failed, ortemporary. Without it the list hides URL imports still downloading, imports that failed, and presigned uploads not confirmed yet.page/per_page: pagination, default 20 per page. See Pagination.
Relabeling or moving a file
PUT /media_contents/{mediaContent} updates editable metadata: label and folder_id (set folder_id to null to move the file back to the root). The underlying binary is immutable. To replace a file, upload a new one and update any posts that reference the old ID.
Deletion
DELETE /media_contents/{mediaContent} is a soft delete. The file is removed from listings and can no longer be attached to new posts, but posts that already reference it continue to work. They hold their own reference to the media at the time of attachment, so deleting the library record does not break a scheduled post.
Next
Upload media
Concrete upload recipes, including bulk import.
Posts
How media is referenced from a post.