files

Upload a file

Create a file for a run's input and get a one-time upload URL.

  • PUT the bytes to upload_url, then pass the file's ID as the file field's value in a run's input.
  • A file can be at most 25 MiB unless the deployment sets otherwise. Executables are refused, and the first bytes must match media_type.
  • A file serves one run. It is erased when that run's job ends, or after an hour if unused.
  • A run's file field also takes an https URL, or a data: URI of at most 512 KB.
post/v1/files

Request

  • Base URL: https://api.pomerado.ai
  • URL: https://api.pomerado.ai/v1/files
  • Auth: HTTP bearer

Request body

namestring required

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

media_typestring required

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

sizeinteger

an integer

Response

The new file, awaiting its upload

idstring required

a file ID: file_ and 32 lowercase hex digits

namestring required

The file's name, as given

media_typestring required

The file's media type, as checked

sizenumber nullable required

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

sha256string nullable required

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

status'awaiting_upload' | 'ready' | 'in_use' required

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

direction'input' | 'output' required

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

job_idstring required

a job ID: job_ and 32 lowercase hex digits

created_atstring required

a string to be decoded into a Date

expires_atstring required

a string to be decoded into a Date

upload_urlstring required

PUT the file's bytes here once, with Content-Type and Content-Length and no Authorization header. Valid until expires_at.

Example response

{
  "id": "file_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190",
  "job_id": "job_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190"
}

Changes

No recorded changes to this operation across all 1 revision of this API.