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

File Uploads

The File Uploads API provides a presigned-URL workflow for uploading files that can be attached to sandbox sessions as resources. Uploads are limited to 100 MB per file.

To obtain your authentication credentials, install the Release CLI and run release auth login. The CLI stores credentials in ~/.release.yaml.


Upload Flow

Uploading a file to a sandbox session is a two-step process:

  1. Get a presigned URL — POST to the endpoint below with the file metadata. The response contains a presigned_url and an s3_uri.

  2. PUT the file content — Send a PUT request to the presigned_url with the raw file bytes as the request body. Set the Content-Type header to the same MIME type you provided in step 1.

Once uploaded, reference the file in a session by using the s3_uri value when creating a session resource of type file (see Session Resources).


Get Presigned Upload URL

Returns a presigned S3 URL that you can PUT file content to, along with an S3 URI for referencing the uploaded file in session resources.

Endpoint

POST https://backend-{handle}-envs.gcp.release.com/ai/accounts/{accountId}/sandbox_uploads

Authentication

Authenticate using headers from your ~/.release.yaml file. To set this up, install the Release CLI and run release auth login.

Header
Description

X-User-Email

User email from ~/.release.yaml (login field)

X-User-Token

User token from ~/.release.yaml (token field)

Headers

Header
Value

Content-Type

application/json

Accept

application/json

Path Parameters

Name
Type
Required
Description

accountId

string (hashid)

Yes

The Release account ID

Request Body

Field
Type
Required
Description

filename

string

Yes

Name of the file to upload

content_type

string

Yes

MIME type of the file (e.g. text/plain, application/zip)

size_bytes

integer

Yes

File size in bytes (maximum 100 MB)

Example

Status Codes

Code
Description

201

Presigned URL generated

401

Unauthorized — invalid or missing credentials

422

Validation error (see error codes below)

Error Codes

Code
Description

file_too_large

File exceeds the 100 MB size limit

no_upload_cluster

No cluster is configured for uploads on this account

Response Body

Field
Type
Description

data.presigned_url

string

URL to PUT the file content to

data.s3_uri

string

S3 URI to reference when creating session resources of type file

Example Responses

201 Created

422 File Too Large

422 No Upload Cluster

Last updated

Was this helpful?