Read the base version
Call Get a file. Keep itscontent 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
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.