Skip to main content
POST
/
v1
/
sandboxes
/
{id}
/
uploads
Create a resumable upload session
import requests

url = "https://api.13-215-85-171.sslip.io/v1/sandboxes/{id}/uploads"

payload = {
    "target_path": "<string>",
    "content_length": 123,
    "checksum_algorithm": "sha256"
}
headers = {
    "Idempotency-Key": "<idempotency-key>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "session": {
    "upload_id": "<string>",
    "target_path": "<string>",
    "content_length": 123,
    "accepted_bytes": 123,
    "reserved_staging_bytes": 123,
    "part_size": 123,
    "part_count": 123,
    "max_concurrency": 123,
    "checksum_algorithm": "sha256",
    "limits": {
      "max_upload_bytes": 123,
      "max_part_bytes": 123,
      "max_concurrency": 123,
      "sandbox_staging_quota_bytes": 123
    },
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "expires_at": "2023-11-07T05:31:56Z",
    "user": "<string>",
    "next_part": 123,
    "archive_format": "tar",
    "whole_checksum_sha256": "<string>"
  }
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Headers

Idempotency-Key
string
required

Reuse the same key to safely retry the same create, reusable snapshot create, fork, upload create/complete, or agent deployment create operation without duplicating work.

Path Parameters

id
string
required

Sandbox ID (e.g. sb_a1b2c3d4)

Body

application/json
kind
enum<string>
required
Available options:
file,
directory_tar
source_kind
enum<string>
required
Available options:
restartable_file,
spooled_stream,
directory_archive
target_path
string
required

Requested upload destination path. Absolute paths may target valid sandbox locations such as /workspace, /tmp, /data, or /context where present. Relative paths resolve from the sandbox cwd when set, otherwise from the selected user's home when user is provided, otherwise from /workspace. Reserved runtime paths under /workspace/.nullspace are rejected.

content_length
integer<uint64>
required
conflict
enum<string>
required
Available options:
merge,
replace,
error
checksum_algorithm
enum<string>
required
Available options:
sha256
user
string

Optional sandbox user for relative-path resolution and ownership.

archive_format
enum<string>
Available options:
tar
whole_checksum_sha256
string
metadata
object

Free-form client-supplied metadata for the upload session; stored verbatim, deliberately open.

Response

200 - application/json

Upload session created

session
object
required