Upload a file with multipart form data or a raw request body
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/file"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/file \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'Files
Upload a file with multipart form data or a raw request body
If Content-Type is multipart/form-data, the API streams the file field into the destination path. Otherwise it streams the raw request body directly into the file.
POST
/
v1
/
machines
/
{id}
/
file
Upload a file with multipart form data or a raw request body
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/file"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/file \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'Authorizations
API key passed as Bearer token
Path Parameters
Machine ID (e.g. mch_a1b2c3d4)
Query Parameters
File path inside the machine. Absolute paths may target valid machine locations such as /workspace, /data, /tmp, 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.
Optional machine user for relative-path resolution and ownership.
Body
multipart/form-dataapplication/octet-stream
Response
204
File uploaded