Name each file and its type, then PUT its bytes to the upload_url that comes back,
straight to storage and in parallel if you like, with the same Content-Type as its
mime_type. There is no size field and no size limit here: one PUT takes a file up to
5 GB. An upload_url is good for an hour. Pass each id as a
{"type": "file", "source": {"type": "file", "file_id": id}} block in a session's or a
follow-up's input. When the session starts, each file's bytes are checked against its
type and its size is read from storage; a file never uploaded is refused there with
409 ATTACHMENT_NOT_UPLOADED. At most 50 files per call. Rate-limited to 30 calls a minute
per caller.
Authenticate with a signed-in session token (an API key cannot call this route).
Path parameters
The org's slug or id. A caller with no role in the org gets 404.
Request body
2 item fields
The file name in the sandbox. No /, \, .., leading ., or control characters.
The file's media type. Send it as the Content-Type of the PUT.
Responses
201An upload URL per file, in the order asked for.
5 item fields
A signed URL to PUT the file to, with Content-Type: <mime_type>.
400Not the JSON shape above, a multipart/form-data body or a size field (INVALID_BODY, naming the shape), an invalid name or type, or more than 50 files (TOO_MANY_FILES).
A sentence for a person.
Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.
The machine code on routes that name it this way.
401No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.
A sentence for a person.
Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.
The machine code on routes that name it this way.
404No such resource for the caller, including one in an org the caller is not in or a Project that is private to someone else.
A sentence for a person.
Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.
The machine code on routes that name it this way.
429Upload rate limit exceeded, or the account is over its 1,800-a-minute request budget.
Upload rate limit exceeded, or the account is over its 1,800-a-minute request budget. Retry-After is set.
A sentence for a person.
Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.
The machine code on routes that name it this way.