Skip to main content

Download File Endpoint

POST /download

Download a file from your session's VM. Send session_id and the file's path inside the VM in file_path (or filename), as JSON or as form fields. The response contains the filename, its size and its content encoded as base64.

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
X-API-Keyheaderstring | nullNonullable

Responses​

200​

Successful Response

application/json​

Resolved schema:

{}

400​

session_id is not a valid UUID; or the JSON body is not an object, or the download failed inside the VM (for example the file does not exist); detail says why.

No response body.

401​

No credentials, or the Bearer token / X-API-Key is invalid.

No response body.

403​

The account is disabled, or a guest token was used; or the session belongs to another account; the api_key form field belongs to another account or is inactive; or the session has no VM and your account may not start VMs yet (see detail.code).

No response body.

404​

Session not found, or the api_key form field is not a known key.

No response body.

422​

Request validation failed, or session_id or file_path (or filename) is missing or empty.

application/json​

Resolved schema:

{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}

Field details:

FieldTypeRequiredDescriptionConstraints
detailarray<object>No
detail[]objectNo
detail[].locarray<string | integer>No
detail[].loc[]string | integerNo
detail[].msgstringNo
detail[].typestringNo

429​

Your plan's per-minute request limit is exceeded, or the session needs a new VM and your concurrent VM limit is reached.

No response body.