Skip to main content
POST
Edit source files with string replacement

Authorizations

Authorization
string
header
required

Cactal API key. Create one in the dashboard or via POST /apiKeys. The plaintext key is shown once at creation.

Body

application/json
websiteId
string
required
Minimum string length: 1
files
object[]
required

Files to edit (up to 50, and 200 edits in total). Every edit across every file commits as one version, or none of them do.

Required array length: 1 - 50 elements
leaseToken
string
required
Minimum string length: 1
dryRun
boolean

Validate every edit and report the replacement counts without committing.

Response

The new head version plus per-file replacement counts.

version
integer
required

Head version after the edit: the previous head plus one, or the unchanged head when changed is false.

changed
boolean
required

false when the edit was a no-op and no new version was created.

files
object[]
required

Per-file replacement counts, in request order. Reported for dryRun calls too, which commit nothing.