Skip to main content

Upload File Endpoint

POST /upload

Upload a file into your session's VM as multipart form data: the file in file, its destination path inside the VM in remote_path, and the session_id. If the session has no VM yet, one is started, which counts toward your VM limit. The response reports the execution time and the credits used.

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
X-API-Keyheaderstring | nullNonullable

Request Body​

Required: Yes

multipart/form-data​

Resolved schema:

{
"properties": {
"file": {
"type": "string",
"format": "binary",
"title": "File"
},
"remote_path": {
"type": "string",
"title": "Remote Path"
},
"session_id": {
"type": "string",
"title": "Session Id"
},
"recursive": {
"type": "boolean",
"title": "Recursive",
"default": false
},
"api_key": {
"type": "string",
"title": "Api Key"
}
},
"type": "object",
"required": [
"file",
"remote_path",
"session_id"
],
"title": "Body_upload_file_endpoint_upload_post"
}

Field details:

FieldTypeRequiredDescriptionConstraints
filestringYesformat=binary
remote_pathstringYes
session_idstringYes
recursivebooleanNodefault=false
api_keystringNo

Responses​

200​

Successful Response

application/json​

Resolved schema:

{}

400​

session_id is not a valid UUID.

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​

Validation Error

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.