Replace the content of a file
Replace the entire file content. Send the file’s lastChangeId as baseChangeId. If the file changed first, the two versions are combined when possible. The response contains the content now saved; use it for the next edit.
Authorizations
Workspace-scoped API key, sent as a bearer token. The recommended header. The workspace is implicit in the key and never appears in a URL.
Path Parameters
The file id, as an earlier response reported it. Always doc_…; a composite id is refused.
"doc_9f2k1x8b3m7q0v"
Body
The file's last content change when this edit started. Send the lastChangeId returned when you read the file.
"chg_7t4p2w9c1n6s8k"
The full new file content. It replaces the live content.
51200"# Refunds\n\nRefunds are processed within 14 days."
Response
Accepted. The edit is in the live files.
Type discriminator. Always edit.
edit The file at its new state. lastChangeId has advanced.
The content now in the live files. Not always the content that was sent: an edit based on an older change is combined with the changes accepted since. Adopt this before editing the file again.
"# Refunds\n\nRefunds are processed within 14 days."