Skip to main content
POST
Upload media files directly to Genviral’s CDN. The returned url can then be used when creating posts via /posts or attaching images to packs via /packs/{packId}/images. The stored path is derived from key scope (partner-api/workspaces/{workspaceId} or partner-api/users/{ownerUserId}).

How It Works

  1. Call this endpoint with the file’s content type
  2. Receive a presigned uploadUrl and the final url (CDN URL)
  3. Upload your file directly to the uploadUrl using a PUT request
  4. Use the url in post creation requests or pack-image attachment requests

Body Parameters

contentType
string
required
MIME type of the file. Supported types:
  • Images: image/jpeg, image/png, image/gif, image/webp, image/heic, image/heif
  • Videos: video/mp4, video/quicktime, video/x-msvideo, video/webm, video/x-m4v
filename
string
Original filename for reference (optional). Used for display purposes only.
duration_sec
number
Optional video duration in seconds. Also accepts duration_seconds, duration, durationSec, or video_duration_sec. Stored with the CDN file record so /posts can hydrate validation metadata when you use the returned url.
bytes
number
Optional file size in bytes. Also accepts size.

Response

Successful requests return 201 with:
  • uploadUrl - Presigned URL to upload your file (expires in 10 minutes)
  • url - CDN URL where your file will be accessible after upload
  • contentType - The content type you specified
  • expiresIn - Seconds until the upload URL expires (600)

Using With Packs

If your goal is to add a local file to a pack:
  1. Call this endpoint and capture data.uploadUrl + data.url.
  2. Upload your bytes to data.uploadUrl with PUT.
  3. Call Add Pack Image with image_url = data.url.

Examples

Upload a video

Error Responses

  • 400 invalid_json - Request body is not valid JSON
  • 422 invalid_payload - Invalid content type or missing required fields
  • 401 - authentication failed (missing/invalid/revoked token)
  • 402 subscription_required - active Creator/Professional/Business plan required
  • 403 tier_not_allowed - Scheduler tier cannot use Partner API
  • 500 create_failed - Failed to initialize upload (retry)
The presigned upload URL expires after 10 minutes. If it expires before you upload, simply request a new one.
POST /files reserves the CDN URL and upload slot. The file is ready for use only after your PUT to uploadUrl succeeds (HTTP 200/204). If needed, verify reachability with a HEAD/GET against data.url before creating a post.