Code references
Upsert branch
Create a new branch if it doesn't exist, or update the branch if it already exists.
Authorization
ApiKey read, writeAuthorization<token>
In: header
Scope: read, write
Path Parameters
repo*string
The repository name
Format
stringbranch*string
The URL-encoded branch name
Format
stringRequest Body
application/json
name*string
The branch name
head*string
An ID representing the branch HEAD. For example, a commit SHA.
updateSequenceId?integer
An optional ID used to prevent older data from overwriting newer data. If no sequence ID is included, the newly submitted data will always be saved.
Format
int64syncTime*UnixMillis
A timestamp indicating when the branch was last synced
Format
int64references?array<>
An array of flag references found on the branch
commitTime?UnixMillis
A timestamp indicating when the branch was last synced
Format
int64Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/api/v2/code-refs/repositories/string/branches/string" \ -H "Content-Type: application/json" \ -d '{ "name": "main", "head": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "syncTime": "1636558831870" }'Empty