POST /uploads
Upload a file for an agent generation or an image generation to work from.
Store one file, such as a deck to import for the files field of POST /agent/generations, or an image for referenceImages on POST /images. Returns the uploadId and filename to pass there.
Stores one file for files on POST /v1.0/agent/generations. Send the raw bytes as application/octet-stream with a Content-Length header; chunked and content-encoded bodies are rejected. Files can be up to 250 MiB, and images up to 50 megapixels. Each upload can be attached to one generation. An upload that is never attached expires two days after it was created.
API key for authentication
The file's media type. It must match the file's contents.
The filename, percent-encoded (for example with encodeURIComponent)
File stored
upl_20261029_6ad0146e9c2b4f1d8e7a5b3c2d1e0f9aStored filename, derived from x-harness-upload-name.
Q3_review.pptxThe filename as sent.
Q3 review.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentationSize in bytes.
2800269A missing mimeType, x-harness-upload-name, or Content-Length; a filename that is not percent-encoded; a body that is not application/octet-stream, is content-encoded, or does not match mimeType; or an unsupported mimeType
Invalid or missing API key
Insufficient credits, or the plan does not include the API
Uploads are unavailable
The body arrived too slowly
The file exceeds 250 MiB, or the image exceeds 50 megapixels
Rate limit exceeded
Too many uploads in progress; retry with backoff
Storing the file timed out
POST /v1.0/uploads?mimeType=application%2Fjavascript HTTP/1.1
Host: public-api.gamma.app
X-API-KEY: YOUR_API_KEY
x-harness-upload-name: text
Content-Type: application/octet-stream
Accept: */*
Content-Length: 8
"binary"{
"uploadId": "upl_20261029_6ad0146e9c2b4f1d8e7a5b3c2d1e0f9a",
"filename": "Q3_review.pptx",
"name": "Q3 review.pptx",
"mimeType": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
"size": 2800269
}Example request
Related
POST /agent/generations to start a generation with
filesPOST /images to use an uploaded image as a reference
Import a presentation for the full flow and prompt patterns
Error codes for upload status codes
Last updated
Was this helpful?