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:
Get a presigned URL — POST to the endpoint below with the file metadata. The response contains a
presigned_urland ans3_uri.PUT the file content — Send a
PUTrequest to thepresigned_urlwith the raw file bytes as the request body. Set theContent-Typeheader 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.
X-User-Email
User email from ~/.release.yaml (login field)
X-User-Token
User token from ~/.release.yaml (token field)
Headers
Content-Type
application/json
Accept
application/json
Path Parameters
accountId
string (hashid)
Yes
The Release account ID
Request Body
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
201
Presigned URL generated
401
Unauthorized — invalid or missing credentials
422
Validation error (see error codes below)
Error Codes
file_too_large
File exceeds the 100 MB size limit
no_upload_cluster
No cluster is configured for uploads on this account
Response Body
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?