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

Get code references statistics for flags

GET
/api/v2/code-refs/statistics/:projectKey
GET
/api/v2/code-refs/statistics/:projectKey
$curl https://app.launchdarkly.com/api/v2/code-refs/statistics/projectKey \
> -H "Authorization: <apiKey>"
1{
2 "flags": {},
3 "_links": {}
4}
Get statistics about all the code references across repositories for all flags in your project that have code references in the default branch, for example, `main`. Optionally, you can include the `flagKey` query parameter to limit your request to statistics about code references for a single flag. This endpoint returns the number of references to your flag keys in your repositories, as well as a link to each repository.
Was this page helpful?
Previous

Get links to code reference repositories for each project

Next
Built with

Get statistics about all the code references across repositories for all flags in your project that have code references in the default branch, for example, main. Optionally, you can include the flagKey query parameter to limit your request to statistics about code references for a single flag. This endpoint returns the number of references to your flag keys in your repositories, as well as a link to each repository.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key

Query parameters

flagKeystringOptionalformat: "string"
Filter results to a specific flag key

Response

Statistic collection response
flagsmap from strings to lists of objects
A map of flag keys to a list of code reference statistics for each code repository in which the flag key appears
_linksmap from strings to objects
The location and content type of related resources

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error