Code references

Upsert branch

PUT
/api/v2/code-refs/repositories/{repo}/branches/{branch}

Create a new branch if it doesn't exist, or update the branch if it already exists.

Authorization

ApiKey read, write
Authorization<token>

In: header

Scope: read, write

Path Parameters

repo*string

The repository name

Formatstring
branch*string

The URL-encoded branch name

Formatstring

Request 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.

Formatint64
syncTime*UnixMillis

A timestamp indicating when the branch was last synced

Formatint64
references?array<>

An array of flag references found on the branch

commitTime?UnixMillis

A timestamp indicating when the branch was last synced

Formatint64

Response 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