Center Grid
Bottom Grid Grid

APIs built from the ground up.

Every feature in LaunchDarkly is API-first and tested thoroughly. Build custom integrations, export raw data, and write custom scripts for automating your feature flag workflows.

APIs banner image

Customize your feature flag experience

Flow

Automatically change the state of a feature flag using other tools in your stack.

Analyze

Extract flag variation data and join it with other event data in a data warehouse.

Target

Update targeting rules dynamically based on business logic stored in other tools.

Integrate

Integrate LaunchDarkly into your own developer dashboards.

Automate

Build automations for copying variation rules, segments, and flags across projects.

Visualize

Create your own UIs and visualizations to see and manage your feature flags.

Create feature flags

Create a new boolean feature flag named "New checkout flow".

const data = {
  "name": "New checkout flow",
  "key": "new-checkout-flow",
  "variations": [
    {
      "value": true,
    },
    {
      "value": false,
    }
  ],
};
fetch("https://app.launchdarkly.com/api/v2/flags/app", {
  method: "POST",
  headers: {
    "Authorization": "YOUR API ACCESS TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(flag => {
  // Do something with the newly created flag
})
Copy code

Update feature flags

Toggle "new-checkout-flow" off.

const data = [
  { 
    "op": "replace", 
    "path": "/environments/production/on", 
    "value": false 
  }
];
fetch("https://app.launchdarkly.com/api/v2/flags/app/new-checkout-flow", {
  method: "PATCH",
  headers: {
    "Authorization": "YOUR API ACCESS TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(flag => {
  // Do something with the newly updated flag
});
Copy code

Find users

Find users with email "useremail@email.com" .

fetch("https://app.launchdarkly.com/api/v2/user-search/app/production?q=useremail@email.com", {
  method: "GET",
  headers: {
    "Authorization": "YOUR API ACCESS TOKEN",
  }
})
.then(response => response.json())
.then(flag => {
  // Do something with user/s
});
Copy code

Copy flag settings

Copy flag settings from the production environment to the test environment.

const data = {
  "projKey": "default",
  "flagKey": "new-checkout-flow",
  "envKey": "production",
  "source":
    {
      "key": "production",
    },
  "target":  {
    "key": "test",
    },
  "includedActions": ["updateRules", "updateOffVariation"]
}
fetch("https://app.launchdarkly.com/api/v2/flags/app/new-checkout-flow/copy", {
  method: "POST",
  headers: {
    "Authorization": "YOUR API ACCESS TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(flag => {
  // Do something with the newly created flag
})
Copy code

We've been able to roll out new features at a pace that would've been unheard of a couple of years ago.

IBMMichael McKayPrincipal Software Engineer

Discover how to deploy code faster with less risk.

Get a demo