Skip to main content
POST
Upload a file
  • PUT the bytes to upload_url, then pass the file’s ID as the file field’s value in a run’s input.
  • Send the same API key or token as Authorization: Bearer on the PUT, or transfer_key as the Pomerado-Transfer-Key header. An upload without either answers unauthorized, except one made with an API key created before uploads needed a key, which works without for 30 days after that, as the key’s unsigned_file_links_until shows.
  • A file can be at most 25 MiB unless the deployment sets otherwise. Executables are refused, and the first bytes must match media_type.
  • The upload_url works for 15 minutes and closes after three refused uploads; then create a new upload.
  • A file serves one run. It is erased when that run’s job ends, or an hour after its upload if unused.
  • An account keeps at most ten runs’ worth of files no run has used yet: 100 files and 500 MiB together by default.
  • A run’s file field also takes an https URL, or a data: URI of at most 512 KB.
  • Callers: an API key, an integration’s API key, an MCP OAuth token or a Dashboard session.
  • Permission: runs:create.
  • Effect: Creates or changes something.
  • Errors: file_too_large, file_type_refused, file_limit_exceeded, sign_in_required, not_configured, and the errors any request can get.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

The file's name, as the website will see it, for example receipt.pdf

Required string length: 1 - 255
media_type
string
required

The file's media type, such as application/pdf; its first bytes must match it

Required string length: 1 - 255
size
integer

The file's size in bytes; if given, the upload's Content-Length must match

Required range: x >= 0
sha256
string

The file's SHA-256 as 64 hex characters, in either case; if given, an upload of other bytes is refused with file_digest_mismatch and stores nothing

Pattern: ^[0-9a-fA-F]{64}$

Response

The new file, awaiting its upload

id
string
required

a file ID: file_ and 32 lowercase hex digits

Example:

"file_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190"

name
string
required

The file's name, as given

media_type
string
required

The file's media type, as checked

size
number | null
required

Bytes: the declared size until the upload arrives, then the size received; null when none was declared

sha256
string | null
required

The SHA-256 of the bytes, lowercase hex, once they arrived

status
enum<string>
required

awaiting_upload until its bytes arrive at upload_url, ready to pass to a run, in_use once a run took it

Available options:
awaiting_upload,
ready,
in_use
direction
enum<string>
required

input for a file sent to a run, output for one a run collected

Available options:
input,
output
job_id
string | null
required

The run's job the file is bound to: an input in use, and every output

Example:

"job_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190"

created_at
string
required

a string to be decoded into a Date

expires_at
string | null
required

When the file is erased unless used first; null for an input in use, which is erased when its job ends

upload_url
string
required

PUT the file's bytes here once, with Content-Type and Content-Length, and with transfer_key as the Pomerado-Transfer-Key header or the same API key or token as Authorization: Bearer. An upload without either answers unauthorized, except one made with an API key created before uploads needed a key, which works without for 30 days after that, as the key's unsigned_file_links_until shows. Valid until expires_at, 15 minutes after it was created; three refused uploads close it.

transfer_key
string
required

This upload's transfer key: send it as the Pomerado-Transfer-Key header on the PUT, for example from a device or worker that doesn't hold your API key. Keep it as private as the URL.