Upload a file into a running sandbox
PUT
/sandboxes/{id}/files
const url = 'https://api.global.stillbox.example/v1/sandboxes/ws-7k2m9q4x8w3z5r6t/files?path=example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream'}, body: 'binary'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url 'https://api.global.stillbox.example/v1/sandboxes/ws-7k2m9q4x8w3z5r6t/files?path=example' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/octet-stream' \ --data binaryCreates missing parent directories and replaces an existing file. Up to 8 MB.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Query Parameters
Section titled “Query Parameters”path
required
string
Absolute path inside the sandbox
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/octet-stream
string format: binary
Responses
Section titled “Responses”The file was written
The request is invalid
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}The API key is missing or invalid
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}No such sandbox in your organization (or no such file)
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}The sandbox isn’t running, or its server is unreachable right now
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}The file is larger than 8 MB
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}