import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{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)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"target_path": "<string>",
"content_length": 123,
"checksum_algorithm": "sha256"
}
'{
"session": {
"upload_id": "<string>",
"kind": "file",
"source_kind": "restartable_file",
"target_path": "<string>",
"content_length": 123,
"accepted_bytes": 123,
"reserved_staging_bytes": 123,
"part_size": 123,
"part_count": 123,
"max_concurrency": 123,
"status": "created",
"conflict": "merge",
"checksum_algorithm": "sha256",
"limits": {
"max_upload_bytes": 123,
"max_part_bytes": 123,
"max_concurrency": 123,
"machine_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>"
}
}Create a resumable upload session
Creates a Firecracker-backed upload session with fixed part_size, max_concurrency, and expires_at values chosen by the runtime. The returned session is the source of truth for resumable file and directory archive uploads.
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{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)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"target_path": "<string>",
"content_length": 123,
"checksum_algorithm": "sha256"
}
'{
"session": {
"upload_id": "<string>",
"kind": "file",
"source_kind": "restartable_file",
"target_path": "<string>",
"content_length": 123,
"accepted_bytes": 123,
"reserved_staging_bytes": 123,
"part_size": 123,
"part_count": 123,
"max_concurrency": 123,
"status": "created",
"conflict": "merge",
"checksum_algorithm": "sha256",
"limits": {
"max_upload_bytes": 123,
"max_part_bytes": 123,
"max_concurrency": 123,
"machine_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
API key passed as Bearer token
Headers
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
Machine ID (e.g. mch_a1b2c3d4)
Body
file, directory_tar restartable_file, spooled_stream, directory_archive Requested upload destination path. Absolute paths may target valid machine locations such as /workspace, /tmp, /data, or /context where present. Relative paths resolve from the machine 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.
merge, replace, error sha256 Optional machine user for relative-path resolution and ownership.
tar Free-form client-supplied metadata for the upload session; stored verbatim, deliberately open.
Response
Upload session created
Show child attributes
Show child attributes