For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
      • POSTCreate extinction
      • POSTCreate repository
      • POSTDelete branches
      • DELDelete repository
      • GETGet branch
      • GETGet code references statistics for flags
      • GETGet links to code reference repositories for each project
      • GETGet repository
      • GETList branches
      • GETList extinctions
      • GETList repositories
      • PATCHUpdate repository
      • PUTUpsert branch
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewCode References

List repositories

GET
/api/v2/code-refs/repositories
GET
/api/v2/code-refs/repositories
$curl https://app.launchdarkly.com/api/v2/code-refs/repositories \
> -H "Authorization: <apiKey>"
1{
2 "_links": {},
3 "items": [
4 {
5 "name": "LaunchDarkly-Docs",
6 "type": "github",
7 "defaultBranch": "main",
8 "enabled": true,
9 "version": 3,
10 "_links": {},
11 "sourceLink": "https://github.com/launchdarkly/LaunchDarkly-Docs",
12 "commitUrlTemplate": "https://github.com/launchdarkly/LaunchDarkly-Docs/commit/${sha}",
13 "hunkUrlTemplate": "https://github.com/launchdarkly/LaunchDarkly-Docs/blob/${sha}/${filePath}#L${lineNumber}",
14 "branches": [
15 {
16 "name": "main",
17 "head": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
18 "syncTime": 1636558831870,
19 "_links": {},
20 "updateSequenceId": 25,
21 "references": [
22 {
23 "path": "/main/index.js",
24 "hunks": [
25 {
26 "startingLineNumber": 45,
27 "lines": "var enableFeature = 'enable-feature';",
28 "projKey": "default",
29 "flagKey": "enable-feature",
30 "aliases": [
31 "enableFeature",
32 "EnableFeature"
33 ]
34 }
35 ],
36 "hint": "javascript"
37 }
38 ]
39 }
40 ],
41 "_access": {
42 "denied": [
43 {
44 "action": "string",
45 "reason": {
46 "effect": "allow",
47 "resources": [
48 "proj/*:env/*;qa_*:/flag/*"
49 ],
50 "notResources": [
51 "string"
52 ],
53 "actions": [
54 "*"
55 ],
56 "notActions": [
57 "string"
58 ],
59 "role_name": "string"
60 }
61 }
62 ],
63 "allowed": [
64 {
65 "action": "string",
66 "reason": {
67 "effect": "allow",
68 "resources": [
69 "proj/*:env/*;qa_*:/flag/*"
70 ],
71 "notResources": [
72 "string"
73 ],
74 "actions": [
75 "*"
76 ],
77 "notActions": [
78 "string"
79 ],
80 "role_name": "string"
81 }
82 }
83 ]
84 }
85 }
86 ]
87}

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.

Was this page helpful?
Previous

Update repository

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Query parameters

withBranchesstringOptionalformat: "string"
If set to any value, the endpoint returns repositories with associated branch data
withReferencesForDefaultBranchstringOptionalformat: "string"
If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch
projKeystringOptionalformat: "string"
A LaunchDarkly project key. If provided, this filters code reference results to the specified project.
flagKeystringOptionalformat: "string"
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
_linksmap from strings to objects
itemslist of objects
An array of repositories

Errors

401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error