---
title: "Get a signed URL to upload a photo or video (up to 1 GB). Files over 50 MB: send \"multipart\": true, PUT bytes [start, end) to each returned part's upload_url, then GET /api/media/finalize?path= returns one media_url for the whole file. Media passed by URL is fetched by us: up to 1GB for TikTok and YouTube (streamed), 80MB elsewhere."
method: POST
path: "/api/media/upload-url"
---

# Get a signed URL to upload a photo or video (up to 1 GB). Files over 50 MB: send "multipart": true, PUT bytes \[start, end) to each returned part's upload_url, then GET /api/media/finalize?path= returns one media_url for the whole file. Media passed by URL is fetched by us: up to 1GB for TikTok and YouTube (streamed), 80MB elsewhere.

`POST /api/media/upload-url`

## Request

- Base URL: `https://postwire.io`
- URL: `https://postwire.io/api/media/upload-url`
- Auth: HTTP bearer

Upload your own file instead of hosting it yourself. The bytes go straight from your client to storage — they never pass through this API. 1) POST here. 2) PUT the raw file bytes to upload_url. 3) GET /api/media/finalize?path=<path> to receive media_url. 4) pass media_url as video_url or photo_url to /api/post. Media is deleted the day after the last scheduled post that uses it is published, and 7 days after upload when no scheduled post uses it (30 days at most, never while a scheduled post still waits for it); the answer's retention object says the same in numbers.

## Request body

- object
  - `content_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif' | 'video/mp4' | 'video/quicktime' | 'video/webm', required
  - `size_bytes` integer
  - `multipart` boolean: true for files over 50 MB: the answer lists parts, each with its own upload_url and byte range [start, end).

## Response `200`

upload_url + path, retention_days (the 30-day cap) and retention {max_days, after_last_post_days, unused_days, rule}

## Other responses

- `413`: code use_multipart (send multipart: true) or too_large (over 1 GB)

---

[API](https://skmtc.dev/postwire/apis/postwire-api.md) · [All operations](https://skmtc.dev/postwire/apis/postwire-api/llms.txt) · [OpenAPI document](https://skmtc.dev/postwire/apis/postwire-api/revisions/513a409ab8f7?raw)
