Skip to main content
PUT
Write a file or create a directory

Authorizations

Authorization
string
header
required

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

Headers

Idempotency-Key
string

Optional client-chosen key (e.g. a UUID, at most 255 characters) that makes the call safe to retry. Within 24 h, the same key with the same request returns the stored response instead of acting twice; the same key with a different request fails with idempotency_key_reused; a request with a key that's still being processed fails with request_in_progress.

Required string length: 1 - 255

Path Parameters

sandbox_id
string
required

Sandbox ID (sb-…).

Required string length: 1 - 64

Query Parameters

path
string
required

Absolute path inside the sandbox, e.g. /app/out.txt, at most 4096 bytes in UTF-8.

Required string length: 1 - 4096
Pattern: ^/
directory
boolean
default:false

Create a directory at path (send an empty body).

Body

application/octet-stream

The file's contents, as raw bytes whatever the Content-Type; empty when directory=true.

The body is of type file.

Response

The file or directory already existed and was replaced or kept.

data
object
required

A file or directory inside the sandbox.