Media
Upload and manage media files for use in posts. Every media file is stored in your workspace's media library and can be referenced by multiple posts.
Upload a file
Use POST /media/upload with a multipart form. Maximum file size is 50 MB.
Code
Response:
Code
Save the id. You reference media on posts by ID through the media_ids field.
Upload from a URL
Skip the download-and-reupload dance by pointing OmniSocials at a public URL. The server fetches the file and stores it in your media library.
Code
The response shape matches POST /media/upload.
Inline URLs on a post
If you only need the media for a single post, skip the media library entirely. Pass URLs directly in media_urls on the post body.
Code
The API downloads, validates, and attaches the file automatically. Maximum 10 URLs per post. Use the media library (via upload or upload-from-url) when the same file appears on multiple posts, to save on download bandwidth.
Supported formats
| Media type | Formats |
|---|---|
| Images | JPEG, PNG, GIF, WebP |
| Videos | MP4, MOV |
Platform-specific size, aspect ratio, and duration requirements are enforced at publish time, not upload time. A video can upload successfully and still fail to publish to Instagram if it exceeds Instagram's length limit. See the Platforms section for per-platform media specs.
Listing and deleting
| Endpoint | Description |
|---|---|
GET /media | List everything in the library |
GET /media/:id | Fetch a single media record |
DELETE /media/:id | Delete from the library |
Deleting a media file does not remove it from posts that have already been published.