v5

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-02-283466592.5 MB
Code references

Get branch

Get a specific branch in a repository.

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

Path parameters

repostring string required

The repository name

The repository name

branchstring string required

The url-encoded branch name

The url-encoded branch name

Query parameters

projKeystring string

Filter results to a specific project

Filter results to a specific project

flagKeystring string

Filter results to a specific flag key

Filter results to a specific flag key

Response

Branch response

namestring required

The branch name

headstring required

An ID representing the branch HEAD. For example, a commit SHA.

updateSequenceIdinteger

An optional ID used to prevent older data from overwriting newer data

syncTimeinteger required
_linksobject required

The location and content type of related resources

Example response

{
  "name": "main",
  "head": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
  "updateSequenceId": 25,
  "references": [
    {
      "path": "/main/index.js",
      "hint": "javascript",
      "hunks": [
        {
          "startingLineNumber": 45,
          "lines": "var enableFeature = 'enable-feature';",
          "projKey": "default",
          "flagKey": "enable-feature",
          "aliases": [
            "enableFeature",
            "EnableFeature"
          ]
        }
      ]
    }
  ]
}