Upload media
POST/media/upload
Request a presigned upload URL for a media file. This is step 1 of the 3-step upload flow:
- POST /media/upload — Get a presigned upload URL (this endpoint)
- Upload your file to the returned
upload_urlusing the method specified inupload_method - POST /media/{id}/complete — Signal that the upload is finished
Upload methods by type:
- Images — POST multipart-form to Cloudflare Images (field name:
file) - Videos — PUT to R2 presigned URL with
Content-Typeheader - Documents — PUT to R2 presigned URL with
Content-Typeheader
Request
Responses
- 201
- 400
- 401
- 429
Upload URL generated
Invalid request parameters
Missing or invalid API key
Rate limit exceeded
Response Headers
X-RateLimit-Limit
Request limit per window
X-RateLimit-Remaining
Remaining requests in current window
X-RateLimit-Reset
Unix timestamp when the window resets
Retry-After
Seconds to wait before retrying