Skip to main content
POST
Edit 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.

edits
_Edit · object[]
required

Ordered exact-string edits. Applied all-or-nothing.

Required array length: 1 - 100 elements
dry_run
boolean
default:false

Return the unified diff without writing.

Response

The diff, applied unless you asked for a dry run.

The diff, and whether it landed.

path
string
required

The normalized path that was edited.

Example:

"src/pages/Home.jsx"

diff
string
required

Unified diff of the change, whether or not it was applied.

Example:

"--- src/pages/Home.jsx\n+++ src/pages/Home.jsx\n@@ -1,3 +1,3 @@\n- return <h1>Hello</h1>;\n+ return <h1>Welcome</h1>;\n"

applied
boolean
required

true when the file was changed, false on a dry_run preview.

Example:

true

warnings
string[] | null

Advisories about the write that did not stop it. Absent entirely on a dry_run, since nothing was written.

Example: