Skip to main content
GET
/
api
/
v2
/
code-refs
/
repositories
/
{repo}
/
branches
/
{branch}
Get branch
curl --request GET \
  --url https://app.launchdarkly.com/api/v2/code-refs/repositories/{repo}/branches/{branch} \
  --header 'Authorization: <api-key>'
{
  "name": "main",
  "head": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
  "syncTime": "1636558831870",
  "_links": {},
  "updateSequenceId": 25,
  "references": [
    {
      "path": "/main/index.js",
      "hunks": [
        {
          "startingLineNumber": 45,
          "lines": "var enableFeature = 'enable-feature';",
          "projKey": "default",
          "flagKey": "enable-feature",
          "aliases": [
            "enableFeature",
            "EnableFeature"
          ]
        }
      ],
      "hint": "javascript"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Path Parameters

repo
string<string>
required

The repository name

branch
string<string>
required

The url-encoded branch name

Query Parameters

projKey
string<string>

Filter results to a specific project

flagKey
string<string>

Filter results to a specific flag key

Response

Branch response

name
string
required

The branch name

Example:

"main"

head
string
required

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

Example:

"a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"

syncTime
integer<int64>
required

A timestamp indicating when the branch was last synced

Example:

"1636558831870"

The location and content type of related resources

updateSequenceId
integer<int64>

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

Example:

25

references
object[]

An array of flag references found on the branch