Replace pending file draft

http
PUT /projects/{project_reference}/branches/{branchName}/files/{filePath}/draft

Replace pending file draft. Requires project.files.write.

Parameters

NameInRequiredDescription
project_referencepathYesProject slug, UUID, or domain that identifies the project.
branchNamepathYes
filePathpathYes

Request body

FieldTypeRequiredDescription
contentstringYesFull 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_versioninteger,nullObserved pending draft sequence; zero means no prior draft. Separate from commit expected-version IDs. Omit for unconditional replacement; a stale sequence returns 409.

Responses

StatusDescription
200Persisted pending draft
400Bad request
401Unauthorized
403Forbidden
404Not found
409Conflict
500Server error