Skip to main content
Read the file before editing it, then send the full new content together with the version you read.

Read the base version

Call Get a file. Keep its content and lastChangeId together: they represent the version your edit starts from.

Submit the new content

Replace the example IDs with values from your file:
baseChangeId must be the lastChangeId of the version you edited. Sending a newer ID with content based on an older read loses that relationship.

Handle the outcome

A successful HTTP status does not always mean content was updated. Handle 202 separately from 200.
A 202 response looks like this:
reason is conflict when edits cannot be combined automatically, or protected when protection requires review. protected takes precedence if both apply. See Change reviews for resolving the change.

Rename, move, or protect

Use Update a file for metadata changes. Send exactly one field per request: name, parentId, or protected. Content replacement uses its own endpoint. Changing protected requires Full access. A key inheriting an owner’s or admin’s permissions can perform this operation. Directly assigned Can read or Can edit permissions do not allow it; use a permitted inheriting key or ask a member with Full access to change protection in the app. See Access management.

Recover after an interrupted request

If the connection closes before a response arrives, the write may already have been processed. Inspect the live file and any changes in review before submitting again. The public API does not provide an idempotency-key parameter.