Media API
The Media API lets you upload remote media files to the Soku media library and render OG template images. Once uploaded, the returned URL can be used in post submissions for video and image content.Upload Remote Media
Download a media file from a remote URL and store it in the Soku media library.Authentication
This endpoint uses API key authentication. Include your API key in thesoku-api-key header.
An active Soku subscription (trialing or active) is required.
Headers
Rate Limit
30 requests per 60 seconds, in addition to the global tier limit. See Rate Limits.Request Body
Response
Status:201 Created
Render OG Template Image
Render an OG image template. This is an alias forPOST /v1/templates and is functionally identical.
Authentication
This endpoint uses API key authentication. Include your API key in thesoku-api-key header.
An active Soku subscription (trialing or active) is required.
Rate Limit
20 requests per 60 seconds, in addition to the global tier limit. See Rate Limits.For full documentation on template rendering including request body, config options, and examples, see the Templates API.
Examples
Upload a video from a remote URL
Upload an image
Upload and then publish
A common workflow is to upload media first, then use the returned URL in a post:Supported Media Formats
The Media API accepts any media file that the source URL serves over HTTP or HTTPS. For best results with social platform publishing, use the following formats:For detailed information on media format requirements and file size limits per platform, see Media Formats & Limits.
Idempotency
TheIdempotency-Key header prevents duplicate uploads when retrying requests.
- Include an
Idempotency-Keyheader with a unique string value onPOST /v1/mediarequests. - If the header is omitted, Soku auto-derives a key from your user ID and a hash of the request payload.
- If you send the same idempotency key with the same request body, the API returns the original cached response without uploading again.
- If you send the same idempotency key with a different request body, the API returns a
409error with codeidempotency_conflict.
Error Responses
Example error response: