Publishing · Media

Get upload URL

Fetches an upload URL.

POSThttps://api.pozy.ai/v1/media/presign
getMediaPresignedUrl

Guide: Media uploads

Request

Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the publishing resource group disabled get 403 resource_group_disabled. Authentication

Request body

application/json, required

  • filenamestringrequired
  • contentTypestringrequired

    One of 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, audio/mpeg, audio/mp4, audio/aac, audio/ogg, audio/wav, audio/webm, audio/x-m4a, application/x-subrip, text/vtt.

  • sizeinteger

Example

curl -X POST "https://api.pozy.ai/v1/media/presign" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "filename": "photo.jpg",
  "contentType": "image/jpeg"
}'

Response

200 on success

  • uploadUrlstring (URL)
  • publicUrlstring (URL)
  • keystring
  • expiresIninteger
200 response
{
  "uploadUrl": "https://pozy.ai/media/example-1.jpg",
  "publicUrl": "https://pozy.ai/media/example-1.jpg",
  "key": "string",
  "expiresIn": 1
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Media