Skip to main content
POST
Write an app file

Authorizations

api_key
string
header
required

Personal API key.

Path Parameters

app_id
string
required

ID of the app whose sandbox to operate on.

Body

application/json
path
string
required

File path relative to the app root.

content
string
required

Full file content to write. To create an empty file (e.g. .gitkeep) use run_command (touch) — the platform write path treats empty content as a delete.

Required string length: 1 - 6000000
overwrite
boolean
default:false

Must be true to overwrite an existing file (destructive). Default false never clobbers.

Response

The file was written.

What the write did.

path
string
required

The normalized path that was written.

Example:

"src/pages/About.jsx"

bytes_written
integer
required

Size of the content written, in bytes.

Example:

214

created
boolean
required

true when the file did not exist before this call.

Example:

true

overwritten
boolean
required

true when the file existed and was replaced. Never true unless you sent overwrite.

Example:

false

warnings
string[]
required

Advisories about the write that did not stop it, such as writing somewhere the builder treats specially. Empty when there are none.

Example: