Media

Create a presigned media upload URL

Creates a presigned URL for uploading an image, video, GIF, or PDF to PostZen-hosted storage. Upload the file with an HTTP PUT to uploadUrl, then reference publicUrl in post mediaItems. This endpoint requires a read-write API key.

post/v1/media/presign

Request

  • Base URL: https://api.postzen.dev
  • URL: https://api.postzen.dev/v1/media/presign
  • Auth: HTTP bearer

Request body

filenamestring required

Original file name. PostZen sanitizes it for storage.

contentType'image/jpeg' | 'image/jpg' | 'image/png' | 'image/webp' | 'image/gif' | 'video/mp4' | 'video/mpeg' | 'video/quicktime' | 'video/avi' | 'video/x-msvideo' | 'video/webm' | 'video/x-m4v' | 'application/pdf' required
sizeinteger

File size in bytes.

profileIdstring

Optional profile scope. If provided, the API key must have access to the profile.

Response

Presigned upload URL created.

uploadUrlstring uri required

Use this URL for the direct file upload.

publicUrlstring uri required

Use this URL in post mediaItems.

keystring required
type'image' | 'video' | 'gif' | 'document' required

Changes

No recorded changes to this operation across all 1 revision of this API.