purpose and every file size up to the purpose’s limit, including multi-GB draft videos.
The examples use API_BASE_URL for your API base URL and API_KEY for your key (see the quickstart).
1. Start the upload
POST /api/v2/media/uploads with the file’s name, type and size:
201 with an upload target:
pathname, of exactly contentType, up to maxBytes, until expiresAt.
2. Send the bytes
Send the raw file as the body ofPUT {url}, with every header in headers, unchanged:
@vercel/blob SDK’s multipart upload with storage.clientToken. It sends parts in parallel and retries each part on its own:
3. Complete the upload
201 with the media asset:
- HEIC photos become JPEG for purposes that normalize images.
.movdrafts up to 200MB become MP4. Larger ones are kept as uploaded.- Draft videos get a poster image.
thumbnailUrlis its/api/v2/media/{id}path.
media.url (/api/v2/media/{id}), never from the storage URL.
Limits
Branding logos have tighter per-kind limits: 4MB for
external-logo, and 2MB for internal-logo and favicon. Pass the kind as context.kind.
Send the file’s real contentType. If you only know the filename, leave contentType out and we use the extension. Generic types such as application/octet-stream are rejected.
Small files: multipart upload
MultipartPOST /api/v2/media (and PUT /api/v2/media/{id} to replace a file) still works for small files, up to 4MB (4,000,000 bytes). Use a direct upload for anything larger.
A file over 4MB gets a 413 with a JSON body pointing you at direct uploads:
413 is plain text (FUNCTION_PAYLOAD_TOO_LARGE), not JSON, so treat any 413 from these endpoints as “use a direct upload”.