Affected: REST API
Overview
Solution
To export your LaunchDarkly flag list using the LaunchDarkly REST API, follow these steps:
-
Generate a LaunchDarkly API access token:
- Log in to your LaunchDarkly account.
- Navigate to Account settings.
- Select "Authorization" and then "Tokens".
- Generate a new API access token with the appropriate permissions (usually "Reader" or "Writer" for this task).
-
Make an API request to get feature flags:
-
The endpoint to get all feature flags is: https://app.launchdarkly.com/api/v2/flags/{projectKey}
-
Example:
curl -i -X GET \
'https://app.launchdarkly.com/api/v2/flags/{projectKey}' \
-H 'Authorization: YOUR_API_KEY_HERE'
The response will be in JSON format, containing details about your feature flags. If you need the flag list in a CSV format, you can convert the JSON data to CSV using a script or an online converter.