Skip to main content
PUT
Write file

Authorizations

Authorization
string
header
required

Use a JWT bearer token or a Veryfront API key in the Authorization header.

Path Parameters

project_reference
string
required

Project slug, UUID, or domain

file_path
string
required

File path (URL-encoded, for example, pages%2Findex.mdx).

Query Parameters

ref
string

Mutable content to address: main or branch:. Omit for main. Release and environment selectors return 400. Supplied aliases must name the same content.

Example:

"branch:feature-x"

branch
string

Branch name or ID; legacy alias for ref=branch:. Supplied aliases must agree.

branch_id
string<uuid>

Branch UUID; legacy alias for ref=branch:. Supplied aliases must agree.

Body

application/json
content
string
required

Replacement textual content in main or the selected branch, stored as a new immutable version. Source-file MIME type is not writable.

expected_checksum
string

Expected current checksum when updating an existing file; ignored on creation. Omission disables this guard.

expected_version_id
string

Expected current version ID when updating an existing file; ignored on creation. Omission disables this guard.

metadata
object

Optional durable file-version metadata for source provenance; service-owned visibility keys are rejected.

expected_absent
boolean

True requires absence atomically when creating; an existing file returns 409. False or omission retains upsert behavior.

Response

File updated successfully

id
string
required

Path-derived file identifier.

file_id
string
required

Alias for id; canonical file identifier committed by this write.

path
string
required

Normalized stored file path.

content
string
required

Text supplied by this write request.

size
number
required

Size of the file content encoded as UTF-8, in bytes.

updated_at
string
required

Response timestamp for the successful update.

version_id
string

Version ID the write produced.

type
enum<string>

File kind: page, function, component or file.

Available options:
page,
function,
component,
file
size_bytes
number

Size of the content encoded as UTF-8, in bytes.

checksum
string | null

SHA-256 content hash, or null when unavailable.