Request Format
The body is newline-delimited JSON. Send metadata first, followed by one or more blob chunks.Request Body Fields
Branch name (for example
main)The commit message
Object with
name and emailArray of file operations (see below)
Commit SHA that must match the branch tip before writing; omit to fast-forward unconditionally
Source branch to copy when
target_branch does not exist. If you also provide expected_head_sha, it must match the source branch head; otherwise the branch is created from the latest base branch commitObject with
name and emailWhen
true, write the target branch under the ephemeral namespaceWhen
true, interpret base_branch as ephemeralFile Operations
path(required): Repository-relative path; leading slashes are strippedoperation:upsert(default) to add or replace content,deleteto remove a filecontent_id(required): Identifier that blob chunks referencemode(optional): File mode such as100644or100755- For
deleteoperations, omit blob chunks—only the metadata entry is required
Blob Chunks
- Each line after the metadata must contain a
blob_chunkobject content_idties the chunk to a file operationdatais base64 encoded; decoded chunks must be 4 MiB or smaller- Use multiple
blob_chunkmessages per file for streaming; mark the last chunk with"eof": true - Empty files should send an EOF chunk with an empty base64 string
JWT Requirements
- The JWT must include the repository in the
repoclaim - Requires
git:writescope
Response
Notes
- Successful requests return
201 Created; validation errors return4xxcodes with error details - Use the SDK’s
repo.createCommit()helper for streaming, chunking, and authentication automatically - The
target_branchmust already exist unless you includebase_branch, in which case the service creates the target branch from that source branch when it is missing - If you passed an
expected_head_sha, the service verifies it matches the source branch head before creating the new branch - Repositories with no refs can still omit
expected_head_shato seed their default branch - Pair
expected_head_shawith a commit SHA to enforce fast-forward semantics during migrations or CI jobs result.old_shais always a 40-character hex string reflecting the previous tip; it is0000000000000000000000000000000000000000when the target branch did not previously exist
Error Responses
Invalid JWT or missing
git:write scopeInvalid request format, missing required fields, or blob chunk validation errors
Expected head SHA doesn’t match current branch tip
Base branch doesn’t exist (when creating new target branch)