This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation. The flows assume you already have the managed project ID and the authenticated user context described in the introduction.
To inspect the files from a branch or a specific revision locally:
downloadUrl before it expires. See Transfer Repository Archives for the HTTP request format.revision.id and branchName if you intend to update the same branch.To edit a downloaded snapshot and commit the complete replacement tree:
uploadUrl, using all returned headers. Wait for the PUT to succeed. The repository has not changed yet.uploadId, the downloaded branchName, and the downloaded revision.id as expectedHeadRevisionId. Supply a commit message and the author's name and email.changed: true means a new commit was created. changed: false means the tree was unchanged and no commit was created.If the expected head is stale, the commit fails with GIT_HEAD_COMMIT_MISMATCH. Download the current branch, reconcile your changes, and upload a new ZIP before retrying with the new revision ID. A concurrent push can also fail with GIT_PUSH_CONFLICT.
A timeout does not tell you whether the commit reached the repository. Before retrying:
revisionId. The returned revision.id identifies the current branch head at the time of that request.expectedHeadRevisionId. A later concurrent change can still cause a conflict.Setting force: true deliberately bypasses the expected-head check and can replace intervening changes. Omit it for the normal edit and recovery flows.
If committing returns REPOSITORY_UPLOAD_NOT_FOUND, the upload may be missing, expired, associated with a different managed project, or replaced while it was being read. Generate a new upload URL for the correct project, upload the ZIP again, and retry with an appropriate expected head.
Last updated: 12 October 2026