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.
Authorization
ApiKey read, writeIn: header
Scope: read, write
Query Parameters
If set to any value, the endpoint returns repositories with associated branch data
stringIf set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch
stringA LaunchDarkly project key. If provided, this filters code reference results to the specified project.
stringIf set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch
stringResponse Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v2/code-refs/repositories"{ "_links": { "property1": { "href": "string", "type": "string" }, "property2": { "href": "string", "type": "string" } }, "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, "syncTime": "1636558831870", "references": [ { "path": "/main/index.js", "hint": "javascript", "hunks": [ { "startingLineNumber": 45, "lines": "var enableFeature = 'enable-feature';", "projKey": "default", "flagKey": "enable-feature", "aliases": [ "enableFeature", "EnableFeature" ] } ] } ], "_links": { "property1": null, "property2": null } } ], "_links": { "property1": null, "property2": null }, "_access": { "denied": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ], "allowed": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ] } } ]}List extinctions GET
Get a list of all extinctions. LaunchDarkly creates an extinction event after you remove all code references to a flag. To learn more, read [About extinction events](https://launchdarkly.com/docs/home/observability/code-references#about-extinction-events).
Create repository POST
Create a repository with the specified name.