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).
| Method | Path | Purpose |
|---|---|---|
| GET | /media | Paginated list (optional workspace_id, folder_id, or root_only) |
| GET | /media/{media_id} | One item by id |
| DELETE | /media/{media_id} | Delete library item and stored file |
| POST | /media/upload/file | One multipart request with file + workspace_id (optional folder_id); max 500MB per file (same as in-app standard upload) |
| POST | /media/upload/url | JSON body: import one or more URLs (direct image/video links, supported social links, Unsplash, etc.) |
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 or video; the API validates and processes it when the post is saved.
media array.
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.