Skip to main content
PUT
Replace pending file draft

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 that identifies the project.

branchName
string
required

Branch name

filePath
string
required

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

Body

application/json
content
string
required

Full pending source-file body; empty strings are valid. Saves durable Yjs repair without creating an immutable version. Identical bodies retain the pending draft sequence.

expected_draft_version
integer | null

Observed pending draft sequence; zero means no prior draft. Separate from commit expected-version IDs. Omit for unconditional replacement; a stale sequence returns 409.

Required range: 0 <= x <= 2147483647

Response

Persisted pending draft

path
string
required

Path of the source file.

content
string
required

Full pending draft body, including empty bodies. A draft without a readable full snapshot is not found.

updated_at
string
required

When the pending draft was last saved.

file_id
string

Id of the source file whose draft was replaced.

version
integer

Current pending draft sequence; resets after commit/discard. Use as expected_draft_version for a guarded draft write.

Required range: x >= 1
entity_type
enum<string>

Canonical source-file type.

Available options:
page,
component,
function,
virtual_file

Hypermedia links to the draft and its file.