Text promotions skip this step entirely. If your content is plain text or HTML, provide it inline via the
content field when creating a promotion.Content-Range headers.
Initiate the upload
Request:Response:
uploadUrlis the relative path for chunk uploads.maxChunkSizeis the maximum bytes per chunk (default 50 MB). The final chunk may be smaller.
Upload the file in chunks
Send the file bytes as one or more Content-Range format:
PUT requests with a Content-Range header.bytes <start>-<end>/<total>, where start and end are zero-based inclusive byte offsets and total is the full file size. For a multi-chunk upload, repeat with the next byte range until the response status is completed.Full upload example
The curl tab covers the single-chunk happy path. The TypeScript and Python tabs handle chunking for large files.Implementation notes
- A promotion references exactly one upload. To review several files, create a separate promotion for each.
- If a chunk fails due to a network error, check the upload status to see how many bytes were received, then resume from that offset.
- Uploading to an already-completed upload returns
409 Conflict.
Common error scenarios
| Scenario | HTTP status | Error code | What to do |
|---|---|---|---|
| File too large for its format | 413 | PAYLOAD_TOO_LARGE | Check the size limits in Introduction |
Missing Content-Range header | 400 | VALIDATION_ERROR | Add Content-Range: bytes <start>-<end>/<total> |
| Chunk body size doesn’t match the range span | 400 | VALIDATION_ERROR | Ensure the body’s byte length equals end - start + 1 |
Content-Range total doesn’t match declared fileSize | 400 | VALIDATION_ERROR | Use the same total in every chunk as the fileSize from initiation |
| Upload already completed | 409 | INVALID_REQUEST | The file is already uploaded; proceed to create the promotion |
| Upload not found | 404 | NOT_FOUND | The upload ID is invalid or the session expired; initiate a new upload |
| Network failure mid-upload | N/A | N/A | GET the upload status to check bytesReceived, then resume from that offset |
Frequently asked questions
Can I upload multiple files for one promotion?
Can I upload multiple files for one promotion?
No. A promotion references exactly one upload. To review several files, create a separate promotion for each.
Can I reuse an upload ID across promotions or versions?
Can I reuse an upload ID across promotions or versions?
Yes. Upload IDs aren’t consumed. The same upload can be referenced by multiple promotions or versions.
Do uploads expire?
Do uploads expire?
Completed uploads are stored indefinitely. If you initiate an upload and never send any chunks, the upload session may eventually become unusable, so complete uploads promptly after initiation.