For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Upload a file

post

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.

Authorizations
X-API-KEYstringRequired

API key for authentication

Query parameters
mimeTypestring · enumRequired

The file's media type. It must match the file's contents.

Possible values:
Header parameters
x-harness-upload-namestringRequired

The filename, percent-encoded (for example with encodeURIComponent)

Body
string · binaryOptional
Responses
200

File stored

application/json
uploadIdstringRequiredExample: upl_20261029_6ad0146e9c2b4f1d8e7a5b3c2d1e0f9a
filenamestringRequired

Stored filename, derived from x-harness-upload-name.

Example: Q3_review.pptx
namestringRequired

The filename as sent.

Example: Q3 review.pptx
mimeTypestringRequiredExample: application/vnd.openxmlformats-officedocument.presentationml.presentation
sizenumberRequired

Size in bytes.

Example: 2800269
post/v1.0/uploads
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
}

Send the file as the raw request body, not as multipart form data, with its media type in mimeType and its name percent-encoded in x-harness-upload-name.

  • Send a Content-Length header. Chunked and content-encoded bodies are rejected.

  • A file can be up to 250 MiB, and an image up to 50 megapixels. mimeType must match the file's contents.

  • Each upload can be attached to one agent generation. To retry an agent generation, upload the file again.

  • A reference image on POST /images does not attach the upload, so you can use it in several image generations until it expires.

  • An upload that is never attached expires two days after it was created.

  • A 503 means too many uploads are in progress. Retry with exponential backoff.

Example request

Last updated

Was this helpful?