v5

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

List repositories

Get a list of connected repositories. Optionally, you can include branch metadata with the withBranches query parameter. Embed references for the default branch with ReferencesForDefaultBranch. You can also filter the list of code references by project key and flag key.

get/api/v2/code-refs/repositories

Query parameters

withBranchesstring string

If set to any value, the endpoint returns repositories with associated branch data

If set to any value, the endpoint returns repositories with associated branch data

withReferencesForDefaultBranchstring string

If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch

If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch

projKeystring string

A LaunchDarkly project key. If provided, this filters code reference results to the specified project.

A LaunchDarkly project key. If provided, this filters code reference results to the specified project.

flagKeystring string

If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch

If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch

Response

Repository collection response

_linksobject required

Example response

{
  "items": [
    {
      "name": "LaunchDarkly-Docs",
      "sourceLink": "https://github.com/launchdarkly/LaunchDarkly-Docs",
      "commitUrlTemplate": "https://github.com/launchdarkly/LaunchDarkly-Docs/commit/${sha}",
      "hunkUrlTemplate": "https://github.com/launchdarkly/LaunchDarkly-Docs/blob/${sha}/${filePath}#L${lineNumber}",
      "type": "github",
      "defaultBranch": "main",
      "enabled": true,
      "version": 3,
      "branches": [
        {
          "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"
                  ]
                }
              ]
            }
          ]
        }
      ],
      "_access": {
        "denied": [
          {
            "reason": {
              "resources": [
                "proj/*:env/*;qa_*:/flag/*"
              ],
              "actions": [
                "*"
              ],
              "effect": "allow"
            }
          }
        ],
        "allowed": [
          {
            "reason": {
              "resources": [
                "proj/*:env/*;qa_*:/flag/*"
              ],
              "actions": [
                "*"
              ],
              "effect": "allow"
            }
          }
        ]
      }
    }
  ]
}