Skip to main content
PUT
/
api
/
v1
/
files
Write a file
curl --request PUT \
  --url https://{sandbox_id_or_name}.sandbox.tensorlake.ai/api/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/octet-stream' \
  --data '"<string>"'
{
  "error": "<string>",
  "code": "<string>"
}
Write bytes to a sandbox path.

Endpoint

PUT /api/v1/files?path=<absolute-or-relative-path>

Example Request

curl -X PUT "https://<sandbox-id>.sandbox.tensorlake.ai/api/v1/files?path=/workspace/config.json" \
  -H "Authorization: Bearer $TENSORLAKE_API_KEY" \
  -H "Content-Type: application/octet-stream" \
  --data-binary '{"debug": true, "port": 8080}'

Response

Tensorlake returns 204 No Content when the write succeeds. Parent directories are created automatically if needed. Paths containing .. are rejected with 403 Forbidden.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

path
string
required

Absolute or relative file path inside the sandbox.

Body

application/octet-stream

The body is of type file.

Response

File written successfully