{"__v":0,"_id":"571fb616d9baf12900c62a3a","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Looking for LaunchDarkly's v1 docs?\",\n  \"body\": \"You are currently viewing the docs for LaunchDarkly v2.  If you are still using our v1 SDKs,  then please see the [v.1 API documentation](http://apidocs.launchdarkly.com/v1.0/docs).\\n\\nIf you have any questions, feel free to email us <a href=\\\"mailto:support@launchdarkly.com?Subject=Version%202\\\">support@launchdarkly.com</a>\"\n}\n[/block]\nWe have an API-first philosophy at LaunchDarkly. Every product feature is built API-first, and our entire product is driven by our REST API, so it's heavily tested and complete.\n\nIf you want to build a custom integration, export your data, or build custom scripts to automate your feature flag workflow, this API guide is the place to start.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"If you're interested in setting up LaunchDarkly, start on our [main documentation](http://docs.launchdarkly.com) site. You'll learn how to set up our SDKs, which is all you need to get started. Most users won't need to peek under the hood.\",\n  \"title\": \"Just getting started?\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"SDKs and our REST API\",\n  \"body\": \"Note that our SDKs are *not* built on top of our REST APIs. They rely on an optimized real-time stream connection that is not part of our REST API.\\n\\nIf you're interested in building an SDK for a platform we don't currently support, check out our [SDK Contributor's guide](http://docs.launchdarkly.com/v2.0/docs/sdk-contributors-guide).\"\n}\n[/block]","category":"571fb615d9baf12900c62a15","createdAt":"2014-12-17T20:52:30.520Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"introduction","sync_unique":"","title":"Introduction","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Introduction


[block:callout] { "type": "info", "title": "Looking for LaunchDarkly's v1 docs?", "body": "You are currently viewing the docs for LaunchDarkly v2. If you are still using our v1 SDKs, then please see the [v.1 API documentation](http://apidocs.launchdarkly.com/v1.0/docs).\n\nIf you have any questions, feel free to email us <a href=\"mailto:support@launchdarkly.com?Subject=Version%202\">support@launchdarkly.com</a>" } [/block] We have an API-first philosophy at LaunchDarkly. Every product feature is built API-first, and our entire product is driven by our REST API, so it's heavily tested and complete. If you want to build a custom integration, export your data, or build custom scripts to automate your feature flag workflow, this API guide is the place to start. [block:callout] { "type": "warning", "body": "If you're interested in setting up LaunchDarkly, start on our [main documentation](http://docs.launchdarkly.com) site. You'll learn how to set up our SDKs, which is all you need to get started. Most users won't need to peek under the hood.", "title": "Just getting started?" } [/block] [block:callout] { "type": "info", "title": "SDKs and our REST API", "body": "Note that our SDKs are *not* built on top of our REST APIs. They rely on an optimized real-time stream connection that is not part of our REST API.\n\nIf you're interested in building an SDK for a platform we don't currently support, check out our [SDK Contributor's guide](http://docs.launchdarkly.com/v2.0/docs/sdk-contributors-guide)." } [/block]
[block:callout] { "type": "info", "title": "Looking for LaunchDarkly's v1 docs?", "body": "You are currently viewing the docs for LaunchDarkly v2. If you are still using our v1 SDKs, then please see the [v.1 API documentation](http://apidocs.launchdarkly.com/v1.0/docs).\n\nIf you have any questions, feel free to email us <a href=\"mailto:support@launchdarkly.com?Subject=Version%202\">support@launchdarkly.com</a>" } [/block] We have an API-first philosophy at LaunchDarkly. Every product feature is built API-first, and our entire product is driven by our REST API, so it's heavily tested and complete. If you want to build a custom integration, export your data, or build custom scripts to automate your feature flag workflow, this API guide is the place to start. [block:callout] { "type": "warning", "body": "If you're interested in setting up LaunchDarkly, start on our [main documentation](http://docs.launchdarkly.com) site. You'll learn how to set up our SDKs, which is all you need to get started. Most users won't need to peek under the hood.", "title": "Just getting started?" } [/block] [block:callout] { "type": "info", "title": "SDKs and our REST API", "body": "Note that our SDKs are *not* built on top of our REST APIs. They rely on an optimized real-time stream connection that is not part of our REST API.\n\nIf you're interested in building an SDK for a platform we don't currently support, check out our [SDK Contributor's guide](http://docs.launchdarkly.com/v2.0/docs/sdk-contributors-guide)." } [/block]
{"__v":1,"_id":"571fb616d9baf12900c62a3b","api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required","params":[],"url":""},"body":"All REST API resources are authenticated with access tokens or session cookies. Other authentication mechanisms are not supported. You can find your access token on your [Account settings](https://app.launchdarkly.com/settings#/tokens) page. \n\nLaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs,  mobile SDKs, and client-side JavaScript SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations (fetching feature flag settings).\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Auth mechanism\",\n    \"h-1\": \"Allowed resources\",\n    \"h-2\": \"Use cases\",\n    \"0-0\": \"Access tokens\",\n    \"0-1\": \"Can access entire REST API\",\n    \"0-2\": \"Building scripts, custom integrations, data export\",\n    \"1-0\": \"SDK keys\",\n    \"2-0\": \"Mobile keys\",\n    \"1-1\": \"Can only access read-only SDK-specific resources and the firehose, restricted to a single environment\",\n    \"2-1\": \"Can only access read-only mobile SDK-specific resources, restricted to a single environment\",\n    \"3-0\": \"Client-side ID\",\n    \"1-2\": \"Server-side SDKs, Firehose API\",\n    \"2-2\": \"Mobile SDKs\",\n    \"3-1\": \"Single environment, only flags marked available to client-side\",\n    \"3-2\": \"Client-side JavaScript\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Keep your access tokens and SDK keys private\",\n  \"body\": \"Access tokens should *never* be exposed in untrusted contexts. Never put your access token in client-side JavaScript, or embed it in a mobile application (LaunchDarkly has special mobile keys that you can embed in mobile apps). If you accidentally expose an access token or SDK key, you can reset it from your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page.\\n\\nThe client-side ID is safe to embed in untrusted contexts-- it's designed for use in client-side JavaScript.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Don't see an access tokens tab?\",\n  \"body\": \"Only account administrators can see the access tokens tab. If you are a reader or writer, contact your account administrator for your access token.\\n\\nIf you are an administrator and do not see an access tokens tab in your Account Settings, you may still be on LaunchDarkly v1.  To upgrade to LaunchDarkly v2, please see the [migration guide](http://docs.launchdarkly.com/docs/migration-guide).  Once you are on v2, you will see the access tokens tab.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Via request header\"\n}\n[/block]\nThe preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Authorization: [[app:access_token]]\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nAgain, you can find your access token on your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Via session cookie\"\n}\n[/block]\nFor testing purposes, you can make API calls directly from your web browser. If you're logged in to the application, the API will use your existing session to authenticate calls.\n\nIf you have a [role](http://docs.launchdarkly.com/v2.0/docs/teams) other than Admin, or have a [custom role](http://docs.launchdarkly.com/v2.0/docs/custom-roles) defined, you may not have permission to perform some API calls.  You'll receive a `401` response code in that case.","category":"571fb615d9baf12900c62a15","createdAt":"2014-12-17T20:52:46.682Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":1,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"authentication","sync_unique":"","title":"Authentication","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Authentication


All REST API resources are authenticated with access tokens or session cookies. Other authentication mechanisms are not supported. You can find your access token on your [Account settings](https://app.launchdarkly.com/settings#/tokens) page. LaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and client-side JavaScript SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations (fetching feature flag settings). [block:parameters] { "data": { "h-0": "Auth mechanism", "h-1": "Allowed resources", "h-2": "Use cases", "0-0": "Access tokens", "0-1": "Can access entire REST API", "0-2": "Building scripts, custom integrations, data export", "1-0": "SDK keys", "2-0": "Mobile keys", "1-1": "Can only access read-only SDK-specific resources and the firehose, restricted to a single environment", "2-1": "Can only access read-only mobile SDK-specific resources, restricted to a single environment", "3-0": "Client-side ID", "1-2": "Server-side SDKs, Firehose API", "2-2": "Mobile SDKs", "3-1": "Single environment, only flags marked available to client-side", "3-2": "Client-side JavaScript" }, "cols": 3, "rows": 4 } [/block] [block:callout] { "type": "danger", "title": "Keep your access tokens and SDK keys private", "body": "Access tokens should *never* be exposed in untrusted contexts. Never put your access token in client-side JavaScript, or embed it in a mobile application (LaunchDarkly has special mobile keys that you can embed in mobile apps). If you accidentally expose an access token or SDK key, you can reset it from your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page.\n\nThe client-side ID is safe to embed in untrusted contexts-- it's designed for use in client-side JavaScript." } [/block] [block:callout] { "type": "info", "title": "Don't see an access tokens tab?", "body": "Only account administrators can see the access tokens tab. If you are a reader or writer, contact your account administrator for your access token.\n\nIf you are an administrator and do not see an access tokens tab in your Account Settings, you may still be on LaunchDarkly v1. To upgrade to LaunchDarkly v2, please see the [migration guide](http://docs.launchdarkly.com/docs/migration-guide). Once you are on v2, you will see the access tokens tab." } [/block] [block:api-header] { "type": "basic", "title": "Via request header" } [/block] The preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests: [block:code] { "codes": [ { "code": "Authorization: [[app:access_token]]", "language": "text" } ] } [/block] Again, you can find your access token on your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page. [block:api-header] { "type": "basic", "title": "Via session cookie" } [/block] For testing purposes, you can make API calls directly from your web browser. If you're logged in to the application, the API will use your existing session to authenticate calls. If you have a [role](http://docs.launchdarkly.com/v2.0/docs/teams) other than Admin, or have a [custom role](http://docs.launchdarkly.com/v2.0/docs/custom-roles) defined, you may not have permission to perform some API calls. You'll receive a `401` response code in that case.
All REST API resources are authenticated with access tokens or session cookies. Other authentication mechanisms are not supported. You can find your access token on your [Account settings](https://app.launchdarkly.com/settings#/tokens) page. LaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and client-side JavaScript SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations (fetching feature flag settings). [block:parameters] { "data": { "h-0": "Auth mechanism", "h-1": "Allowed resources", "h-2": "Use cases", "0-0": "Access tokens", "0-1": "Can access entire REST API", "0-2": "Building scripts, custom integrations, data export", "1-0": "SDK keys", "2-0": "Mobile keys", "1-1": "Can only access read-only SDK-specific resources and the firehose, restricted to a single environment", "2-1": "Can only access read-only mobile SDK-specific resources, restricted to a single environment", "3-0": "Client-side ID", "1-2": "Server-side SDKs, Firehose API", "2-2": "Mobile SDKs", "3-1": "Single environment, only flags marked available to client-side", "3-2": "Client-side JavaScript" }, "cols": 3, "rows": 4 } [/block] [block:callout] { "type": "danger", "title": "Keep your access tokens and SDK keys private", "body": "Access tokens should *never* be exposed in untrusted contexts. Never put your access token in client-side JavaScript, or embed it in a mobile application (LaunchDarkly has special mobile keys that you can embed in mobile apps). If you accidentally expose an access token or SDK key, you can reset it from your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page.\n\nThe client-side ID is safe to embed in untrusted contexts-- it's designed for use in client-side JavaScript." } [/block] [block:callout] { "type": "info", "title": "Don't see an access tokens tab?", "body": "Only account administrators can see the access tokens tab. If you are a reader or writer, contact your account administrator for your access token.\n\nIf you are an administrator and do not see an access tokens tab in your Account Settings, you may still be on LaunchDarkly v1. To upgrade to LaunchDarkly v2, please see the [migration guide](http://docs.launchdarkly.com/docs/migration-guide). Once you are on v2, you will see the access tokens tab." } [/block] [block:api-header] { "type": "basic", "title": "Via request header" } [/block] The preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests: [block:code] { "codes": [ { "code": "Authorization: [[app:access_token]]", "language": "text" } ] } [/block] Again, you can find your access token on your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page. [block:api-header] { "type": "basic", "title": "Via session cookie" } [/block] For testing purposes, you can make API calls directly from your web browser. If you're logged in to the application, the API will use your existing session to authenticate calls. If you have a [role](http://docs.launchdarkly.com/v2.0/docs/teams) other than Admin, or have a [custom role](http://docs.launchdarkly.com/v2.0/docs/custom-roles) defined, you may not have permission to perform some API calls. You'll receive a `401` response code in that case.
{"__v":0,"_id":"571fb616d9baf12900c62a3c","api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required","params":[],"url":""},"body":"All resources expect and return JSON response bodies. Error responses will also send a JSON body-- see [Errors](doc:errors) for a more detailed description of the error format used by the API. \n\nIn practice this means that you'll always get a response with a `Content-Type` header set to `application/json`.\n\nIn addition, request bodies for `PUT`, `POST`, `REPORT` and `PATCH` requests must be encoded as JSON with a `Content-Type` header set to `application/json`.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Summary and detailed representations\"\n}\n[/block]\nWhen you fetch a list of resources, the response will only include the most important attributes of each resource. This is a *summary representation* of the resource. When you fetch an individual resource (for example, a single feature flag), you'll receive a *detailed representation* containing all of the attributes of the resource.\n\nThe best way to find a detailed representation is to follow links-- every summary representation includes a link to its detailed representation.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Links and addressability\"\n}\n[/block]\nThe best way to navigate the API is by following links-- these are attributes in representations that link to other resources. The API always uses the same format for links:\n\n* Links to other resources within the API are encapsulated in a `_links` object.\n* If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link.\n\nEach link has two attributes: an href (the URL) and a type (the content type). For example, a feature resource might return the following: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"_links\\\":{\\n      \\\"parent\\\":{\\n         \\\"href\\\":\\\"/api/features\\\",\\n         \\\"type\\\":\\\"application/json\\\"\\n      },\\n      \\\"self\\\":{\\n         \\\"href\\\":\\\"/api/features/sort.order\\\",\\n         \\\"type\\\":\\\"application/json\\\"\\n      }\\n   },\\n\\\"_site\\\":{\\n      \\\"href\\\":\\\"/features/sort.order\\\",\\n      \\\"type\\\":\\\"text/html\\\"\\n   }\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nFrom this, we can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Collections\"\n}\n[/block]\nCollections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections will have `_links` defined at the top level.\n\nPaginated collections will include a `next` link containing a URL with the next set of elements in the collection. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Updates via JSON patch\"\n}\n[/block]\nResources that accept partial updates use the `PATCH` verb, and require entity bodies in [JSON Patch](http://tools.ietf.org/html/rfc6902) format.\n\nJSON Patch is a way to specify the modifications to perform on a resource. For example, given a feature flag representation:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"name\\\": \\\"New recommendations engine\\\",\\n  \\\"key\\\": \\\"engine.enable\\\",\\n  \\\"description\\\": \\\"This is the description\\\",\\n  ...\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nWe can change the feature flag's description with the following patch document:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  { \\\"op\\\": \\\"replace\\\", \\\"path\\\": \\\"/description\\\", \\\"value\\\": \\\"This is the new description\\\"}\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nNotice that JSON Patch documents are always arrays-- you can specify multiple modifications to perform in a single request. You can even test that certain preconditions are met before applying the patch:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  { \\\"op\\\": \\\"test\\\", \\\"path\\\": \\\"/version\\\", \\\"value\\\": 10 },\\n  { \\\"op\\\": \\\"replace\\\", \\\"path\\\": \\\"/description\\\", \\\"value\\\": \\\"The new description\\\" }\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe above patch request will test whether the feature flag's `version` is `10`, and if so, will change the feature flag's description.\n\nBy convention, attributes that aren't editable (like a resource's `_links`) have names that start with an underscore.","category":"571fb615d9baf12900c62a15","createdAt":"2014-12-17T23:50:17.485Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"representations","sync_unique":"","title":"Representations","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Representations


All resources expect and return JSON response bodies. Error responses will also send a JSON body-- see [Errors](doc:errors) for a more detailed description of the error format used by the API. In practice this means that you'll always get a response with a `Content-Type` header set to `application/json`. In addition, request bodies for `PUT`, `POST`, `REPORT` and `PATCH` requests must be encoded as JSON with a `Content-Type` header set to `application/json`. [block:api-header] { "type": "basic", "title": "Summary and detailed representations" } [/block] When you fetch a list of resources, the response will only include the most important attributes of each resource. This is a *summary representation* of the resource. When you fetch an individual resource (for example, a single feature flag), you'll receive a *detailed representation* containing all of the attributes of the resource. The best way to find a detailed representation is to follow links-- every summary representation includes a link to its detailed representation. [block:api-header] { "type": "basic", "title": "Links and addressability" } [/block] The best way to navigate the API is by following links-- these are attributes in representations that link to other resources. The API always uses the same format for links: * Links to other resources within the API are encapsulated in a `_links` object. * If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link. Each link has two attributes: an href (the URL) and a type (the content type). For example, a feature resource might return the following: [block:code] { "codes": [ { "code": "\"_links\":{\n \"parent\":{\n \"href\":\"/api/features\",\n \"type\":\"application/json\"\n },\n \"self\":{\n \"href\":\"/api/features/sort.order\",\n \"type\":\"application/json\"\n }\n },\n\"_site\":{\n \"href\":\"/features/sort.order\",\n \"type\":\"text/html\"\n }", "language": "json" } ] } [/block] From this, we can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link. [block:api-header] { "type": "basic", "title": "Collections" } [/block] Collections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections will have `_links` defined at the top level. Paginated collections will include a `next` link containing a URL with the next set of elements in the collection. [block:api-header] { "type": "basic", "title": "Updates via JSON patch" } [/block] Resources that accept partial updates use the `PATCH` verb, and require entity bodies in [JSON Patch](http://tools.ietf.org/html/rfc6902) format. JSON Patch is a way to specify the modifications to perform on a resource. For example, given a feature flag representation: [block:code] { "codes": [ { "code": "{\n \"name\": \"New recommendations engine\",\n \"key\": \"engine.enable\",\n \"description\": \"This is the description\",\n ...\n}", "language": "json" } ] } [/block] We can change the feature flag's description with the following patch document: [block:code] { "codes": [ { "code": "[\n { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\"}\n]", "language": "json" } ] } [/block] Notice that JSON Patch documents are always arrays-- you can specify multiple modifications to perform in a single request. You can even test that certain preconditions are met before applying the patch: [block:code] { "codes": [ { "code": "[\n { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 },\n { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }\n]", "language": "json" } ] } [/block] The above patch request will test whether the feature flag's `version` is `10`, and if so, will change the feature flag's description. By convention, attributes that aren't editable (like a resource's `_links`) have names that start with an underscore.
All resources expect and return JSON response bodies. Error responses will also send a JSON body-- see [Errors](doc:errors) for a more detailed description of the error format used by the API. In practice this means that you'll always get a response with a `Content-Type` header set to `application/json`. In addition, request bodies for `PUT`, `POST`, `REPORT` and `PATCH` requests must be encoded as JSON with a `Content-Type` header set to `application/json`. [block:api-header] { "type": "basic", "title": "Summary and detailed representations" } [/block] When you fetch a list of resources, the response will only include the most important attributes of each resource. This is a *summary representation* of the resource. When you fetch an individual resource (for example, a single feature flag), you'll receive a *detailed representation* containing all of the attributes of the resource. The best way to find a detailed representation is to follow links-- every summary representation includes a link to its detailed representation. [block:api-header] { "type": "basic", "title": "Links and addressability" } [/block] The best way to navigate the API is by following links-- these are attributes in representations that link to other resources. The API always uses the same format for links: * Links to other resources within the API are encapsulated in a `_links` object. * If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link. Each link has two attributes: an href (the URL) and a type (the content type). For example, a feature resource might return the following: [block:code] { "codes": [ { "code": "\"_links\":{\n \"parent\":{\n \"href\":\"/api/features\",\n \"type\":\"application/json\"\n },\n \"self\":{\n \"href\":\"/api/features/sort.order\",\n \"type\":\"application/json\"\n }\n },\n\"_site\":{\n \"href\":\"/features/sort.order\",\n \"type\":\"text/html\"\n }", "language": "json" } ] } [/block] From this, we can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link. [block:api-header] { "type": "basic", "title": "Collections" } [/block] Collections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections will have `_links` defined at the top level. Paginated collections will include a `next` link containing a URL with the next set of elements in the collection. [block:api-header] { "type": "basic", "title": "Updates via JSON patch" } [/block] Resources that accept partial updates use the `PATCH` verb, and require entity bodies in [JSON Patch](http://tools.ietf.org/html/rfc6902) format. JSON Patch is a way to specify the modifications to perform on a resource. For example, given a feature flag representation: [block:code] { "codes": [ { "code": "{\n \"name\": \"New recommendations engine\",\n \"key\": \"engine.enable\",\n \"description\": \"This is the description\",\n ...\n}", "language": "json" } ] } [/block] We can change the feature flag's description with the following patch document: [block:code] { "codes": [ { "code": "[\n { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\"}\n]", "language": "json" } ] } [/block] Notice that JSON Patch documents are always arrays-- you can specify multiple modifications to perform in a single request. You can even test that certain preconditions are met before applying the patch: [block:code] { "codes": [ { "code": "[\n { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 },\n { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }\n]", "language": "json" } ] } [/block] The above patch request will test whether the feature flag's `version` is `10`, and if so, will change the feature flag's description. By convention, attributes that aren't editable (like a resource's `_links`) have names that start with an underscore.
{"__v":0,"_id":"571fb616d9baf12900c62a3d","api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"auth":"required","params":[],"url":""},"body":"The API always returns errors in a common format. Here's an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"code\\\":\\\"invalid_request\\\",\\n   \\\"message\\\":\\\"A feature with that key already exists\\\",\\n   \\\"id\\\":\\\"30ce6058-87da-11e4-b116-123b93f75cba\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe general class of error is indicated by the `code`. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier-- use it when you're working with LaunchDarkly support to debug a problem with a specific API call.","category":"571fb615d9baf12900c62a15","createdAt":"2014-12-17T23:50:27.557Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"errors","sync_unique":"","title":"Errors","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Errors


The API always returns errors in a common format. Here's an example: [block:code] { "codes": [ { "code": "{\n \"code\":\"invalid_request\",\n \"message\":\"A feature with that key already exists\",\n \"id\":\"30ce6058-87da-11e4-b116-123b93f75cba\"\n}", "language": "json" } ] } [/block] The general class of error is indicated by the `code`. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier-- use it when you're working with LaunchDarkly support to debug a problem with a specific API call.
The API always returns errors in a common format. Here's an example: [block:code] { "codes": [ { "code": "{\n \"code\":\"invalid_request\",\n \"message\":\"A feature with that key already exists\",\n \"id\":\"30ce6058-87da-11e4-b116-123b93f75cba\"\n}", "language": "json" } ] } [/block] The general class of error is indicated by the `code`. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier-- use it when you're working with LaunchDarkly support to debug a problem with a specific API call.
{"__v":0,"_id":"571fb616d9baf12900c62a3e","api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required","params":[],"url":""},"body":"The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin.  If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise, a wildcard will be returned: `Access-Control-Allow-Origin: *`.  For more information on CORS, see the [CORS W3C Recommendation](http://www.w3.org/TR/cors).  Example CORS headers might look like:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization\\nAccess-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH\\nAccess-Control-Allow-Origin: *\\nAccess-Control-Max-Age: 300\",\n      \"language\": \"http\",\n      \"name\": \"Example CORS Headers\"\n    }\n  ]\n}\n[/block]\nYou can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](doc:authentication). If you’re using session auth, you should set the `withCredentials` property for your `xhr` request to `true`. Remember-- you should never expose your access tokens to untrusted users.","category":"571fb615d9baf12900c62a15","createdAt":"2015-05-19T00:46:07.225Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"cors","sync_unique":"","title":"CORS","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

CORS


The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise, a wildcard will be returned: `Access-Control-Allow-Origin: *`. For more information on CORS, see the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like: [block:code] { "codes": [ { "code": "Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization\nAccess-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH\nAccess-Control-Allow-Origin: *\nAccess-Control-Max-Age: 300", "language": "http", "name": "Example CORS Headers" } ] } [/block] You can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](doc:authentication). If you’re using session auth, you should set the `withCredentials` property for your `xhr` request to `true`. Remember-- you should never expose your access tokens to untrusted users.
The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise, a wildcard will be returned: `Access-Control-Allow-Origin: *`. For more information on CORS, see the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like: [block:code] { "codes": [ { "code": "Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization\nAccess-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH\nAccess-Control-Allow-Origin: *\nAccess-Control-Max-Age: 300", "language": "http", "name": "Example CORS Headers" } ] } [/block] You can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](doc:authentication). If you’re using session auth, you should set the `withCredentials` property for your `xhr` request to `true`. Remember-- you should never expose your access tokens to untrusted users.
{"__v":0,"_id":"57be1234fc5c4b1700ca6dd1","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"Projects allow you to manage multiple different software projects under one LaunchDarkly account. Each project has its own unique set of environments and feature flags. \n\nUsing the Projects API, you can create, destroy, and manage projects.","category":"578d6fc62441e13200a14321","createdAt":"2016-08-24T21:31:32.872Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"projects-overview","sync_unique":"","title":"Projects overview","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Projects overview


Projects allow you to manage multiple different software projects under one LaunchDarkly account. Each project has its own unique set of environments and feature flags. Using the Projects API, you can create, destroy, and manage projects.
Projects allow you to manage multiple different software projects under one LaunchDarkly account. Each project has its own unique set of environments and feature flags. Using the Projects API, you can create, destroy, and manage projects.
{"__v":0,"_id":"57be1544e6b5cb19001bb92f","api":{"auth":"required","examples":{"codes":[]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"_links\": {\n    \"self\": {\n      \"href\": \"/api/v2/projects\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"items\": [\n    {\n      \"_links\": {\n        \"environments\": {\n          \"href\": \"/api/v2/projects/zentasks/environments\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/projects/zentasks\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"_id\": \"573e1e203e631d070e00000a\",\n      \"key\": \"zentasks\",\n      \"name\": \"Zentasks\",\n      \"environments\": [\n        {\n          \"_links\": {\n          },\n          \"_id\": \"573e20c78101c4070f00001d\",\n          \"key\": \"sample\",\n          \"name\": \"Sample Env\",\n          \"apiKey\": \"XXX\",\n          \"mobileKey\": \"XXX\",\n          \"color\": \"f1519a\",\n          \"defaultTtl\": 3,\n          \"secureMode\": false\n        },\n        {\n          \"_links\": {\n          },\n          \"_id\": \"573e1e203e631d070e00000b\",\n          \"key\": \"test\",\n          \"name\": \"Test\",\n          \"apiKey\": \"XXX\",\n          \"mobileKey\": \"XXX\",\n          \"color\": \"F5A623\",\n          \"defaultTtl\": 0,\n          \"secureMode\": false\n        },\n        {\n          \"_links\": {\n          },\n          \"_id\": \"573e1e203e631d070e00000c\",\n          \"key\": \"production\",\n          \"name\": \"Production\",\n          \"apiKey\": \"XXX\",\n          \"mobileKey\": \"XXX\",\n          \"color\": \"417505\",\n          \"defaultTtl\": 0,\n          \"secureMode\": false\n        }\n      ]\n    },\n    {\n      \"_links\": {\n        \"environments\": {\n          \"href\": \"/api/v2/projects/default/environments\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/projects/default\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"_id\": \"548f6741c1efad40031b18ae\",\n      \"key\": \"default\",\n      \"name\": \"Spree demo app\",\n      \"environments\": [\n        {\n          \"_links\": {\n          },\n          \"_id\": \"5793fcdae1236b073ba8c759\",\n          \"key\": \"ag-testing\",\n          \"name\": \"Alexis dev\",\n          \"apiKey\": \"XXX\",\n          \"mobileKey\": \"XXX\",\n          \"color\": \"3bff00\",\n          \"defaultTtl\": 0,\n          \"secureMode\": false\n        },\n        {\n          \"_links\": {\n          },\n          \"_id\": \"55b9522668c16a26fe000003\",\n          \"key\": \"jko-testing\",\n          \"name\": \"John dev\",\n          \"apiKey\": \"XXX\",\n          \"mobileKey\": \"XXX\",\n          \"color\": \"8619f9\",\n          \"defaultTtl\": 1,\n          \"secureMode\": false\n        }\n      ]\n    }\n  ]\n}","name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/projects"},"body":"Returns a list of all projects in the account.","category":"578d6fc62441e13200a14321","createdAt":"2016-08-24T21:44:36.098Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"list-projects","sync_unique":"","title":"List projects","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getList projects


Returns a list of all projects in the account.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Returns a list of all projects in the account.
{"__v":1,"_id":"57be163f7987bf170063fa0c","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57be1749e6b5cb19001bb931","default":"","desc":"The project key","in":"path","name":"projKey","ref":"","required":false,"type":"string"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"_links\": {\n    \"environments\": {\n      \"href\": \"/api/v2/projects/zentasks/environments\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/projects/zentasks\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"_id\": \"573e1e203e631d070e00000a\",\n  \"key\": \"zentasks\",\n  \"name\": \"Zentasks\",\n  \"environments\": [\n    {\n      \"_links\": {\n      },\n      \"_id\": \"573e20c78101c4070f00001d\",\n      \"key\": \"sample\",\n      \"name\": \"Sample Env\",\n      \"apiKey\": \"XXX\",\n      \"mobileKey\": \"XXX\",\n      \"color\": \"f1519a\",\n      \"defaultTtl\": 3,\n      \"secureMode\": false\n    },\n    {\n      \"_links\": {\n      },\n      \"_id\": \"573e1e203e631d070e00000b\",\n      \"key\": \"test\",\n      \"name\": \"Test\",\n      \"apiKey\": \"XXX\",\n      \"mobileKey\": \"XXX\",\n      \"color\": \"F5A623\",\n      \"defaultTtl\": 0,\n      \"secureMode\": false\n    },\n    {\n      \"_links\": {\n      },\n      \"_id\": \"573e1e203e631d070e00000c\",\n      \"key\": \"production\",\n      \"name\": \"Production\",\n      \"apiKey\": \"XXX\",\n      \"mobileKey\": \"XXX\",\n      \"color\": \"417505\",\n      \"defaultTtl\": 0,\n      \"secureMode\": false\n    }\n  ]\n}","name":""},{"status":404,"language":"json","code":"{\nmessage: \"Unknown project key :key\"\n}"}]},"settings":"57be249fddc0880e006f3b4a","url":"/projects/:projKey"},"body":"Fetch a single project by key.","category":"578d6fc62441e13200a14321","createdAt":"2016-08-24T21:48:47.195Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"get-project","sync_unique":"","title":"Get project","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getGet project


Path Params

projKey:
string
The project key
Fetch a single project by key.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Fetch a single project by key.
{"__v":1,"_id":"57be1a0615efc70e006a5f94","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57be1df4c248140e00858133","ref":"","in":"body","required":false,"desc":"The name of the new project","default":"","type":"string","name":"name"},{"_id":"57be1df4c248140e00858132","ref":"","in":"body","required":false,"desc":"A unique key for the new project","default":"","type":"string","name":"key"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n  \"_links\": {\n    \"environments\": {\n      \"href\": \"/api/v2/projects/new-project/environments\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/projects/new-project\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"_id\": \"57be1db38b75bf0772d11383\",\n  \"key\": \"new-project\",\n  \"name\": \"New project\",\n  \"environments\": [\n    {\n      \"_links\": {\n      },\n      \"_id\": \"57be1db38b75bf0772d11384\",\n      \"key\": \"test\",\n      \"name\": \"Test\",\n      \"apiKey\": \"XXX\",\n      \"mobileKey\": \"XXX,\n      \"color\": \"F5A623\",\n      \"defaultTtl\": 0,\n      \"secureMode\": false\n    },\n    {\n      \"_links\": {\n      },\n      \"_id\": \"57be1db38b75bf0772d11385\",\n      \"key\": \"production\",\n      \"name\": \"Production\",\n      \"apiKey\": \"XXX\",\n      \"mobileKey\": \"XXX\",\n      \"color\": \"417505\",\n      \"defaultTtl\": 0,\n      \"secureMode\": false\n    }\n  ]\n}","name":""},{"status":400,"language":"json","code":"{\n  \"message\": \"Missing field key\"\n}","name":""},{"status":409,"language":"text","code":"{\"message\":\"Account already has a project with that key\"}"}]},"settings":"57be2876ddc0880e006f3b4d","url":"/projects"},"body":"Create a new project with the given key and name. Project keys must be unique within an account.","category":"578d6fc62441e13200a14321","createdAt":"2016-08-24T22:04:54.643Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"create-project","sync_unique":"","title":"Create project","type":"post","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

postCreate project


Body Params

name:
string
The name of the new project
key:
string
A unique key for the new project
Create a new project with the given key and name. Project keys must be unique within an account.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Create a new project with the given key and name. Project keys must be unique within an account.
{"__v":1,"_id":"57be1f83c248140e00858137","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57be202fddc0880e006f3b42","default":"","desc":"The key of the project to delete","in":"path","name":"projKey","ref":"","required":false,"type":"string"}],"results":{"codes":[{"status":204,"language":"json","code":"","name":""},{"status":404,"language":"json","code":"{\n    \"message\": \"Unknown project key :key\"\n}","name":""},{"code":"{\n  \"message\": \"Cannot delete last project in an account\"\n}","language":"json","status":400}]},"settings":"57be249fddc0880e006f3b4a","url":"/projects/:projKey"},"body":"Delete a project by key. **Caution**-- deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.","category":"578d6fc62441e13200a14321","createdAt":"2016-08-24T22:28:19.870Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"delete-project","sync_unique":"","title":"Delete project","type":"delete","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

deleteDelete project


Path Params

projKey:
string
The key of the project to delete
Delete a project by key. **Caution**-- deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.

User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}


Delete a project by key. **Caution**-- deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.
{"__v":5,"_id":"57be20af15efc70e006a5f9e","api":{"auth":"required","examples":{"codes":[{"language":"json","code":"[\n  {\"op\": \"replace\", \"path\": \"/name\", \"value\": \"New project name\"}\n]"}]},"params":[{"_id":"57be20e1c90f500e0082a3a7","default":"","desc":"The project's key","in":"path","name":"projKey","ref":"","required":false,"type":"string"}],"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{\n  \"message\": \"Unsupported json-patch operation\"\n}","language":"json","status":400}]},"settings":"57be24d969196d0e00d0b5de","url":"/projects/:projKey"},"body":"Update a project. Requires a [JSON Patch](https://tools.ietf.org/html/rfc6902) representation of the desired changes to the project.","category":"578d6fc62441e13200a14321","createdAt":"2016-08-24T22:33:19.255Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":5,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"update-project","sync_unique":"","title":"Update project","type":"patch","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

patchUpdate project


Path Params

projKey:
string
The project's key
Update a project. Requires a [JSON Patch](https://tools.ietf.org/html/rfc6902) representation of the desired changes to the project.

User Information

Try It Out


patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Update a project. Requires a [JSON Patch](https://tools.ietf.org/html/rfc6902) representation of the desired changes to the project.
{"__v":0,"_id":"57be348ac90f500e0082a3bd","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"Environments allow you to maintain separate rollout rules in different contexts--  from local development to QA, staging, and production. With the LaunchDarkly Environments API, you can programmatically create, delete, and update environments.","category":"578d6fd021c6a81900ba272e","createdAt":"2016-08-24T23:58:02.140Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"environments-overview","sync_unique":"","title":"Environments overview","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Environments overview


Environments allow you to maintain separate rollout rules in different contexts-- from local development to QA, staging, and production. With the LaunchDarkly Environments API, you can programmatically create, delete, and update environments.
Environments allow you to maintain separate rollout rules in different contexts-- from local development to QA, staging, and production. With the LaunchDarkly Environments API, you can programmatically create, delete, and update environments.
{"__v":0,"_id":"57be2c3769196d0e00d0b5e3","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57be2c3769196d0e00d0b5e5","default":"","desc":"The project key","in":"path","name":"projKey","ref":"","required":false,"type":"string"},{"_id":"57be2c3769196d0e00d0b5e4","default":"","desc":"The environment key","in":"path","name":"envKey","ref":"","required":false,"type":"string"}],"results":{"codes":[{"name":"","code":"{\n    \"_links\": {\n    },\n    \"_id\": \"57ae15fc40cda6071f6c242e\",\n    \"key\": \"production\",\n    \"name\": \"Production\",\n    \"apiKey\": \"XXX\",\n    \"mobileKey\": \"XXX\",\n    \"color\": \"417505\",\n    \"defaultTtl\": 0,\n    \"secureMode\": false\n}","language":"json","status":200},{"status":404,"language":"text","code":"{\n    \"message\": \"Unknown environment key :envKey\"\n}"}]},"settings":"57be249fddc0880e006f3b4a","url":"/projects/:projKey/environments/:envKey"},"body":"Get an environment given a project and key.","category":"578d6fd021c6a81900ba272e","createdAt":"2016-08-24T23:22:31.043Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"get-environment","sync_unique":"","title":"Get environment","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getGet environment


Path Params

projKey:
string
The project key
envKey:
string
The environment key
Get an environment given a project and key.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Get an environment given a project and key.
{"__v":2,"_id":"57be2d7c15efc70e006a5fac","api":{"auth":"required","examples":{"codes":[{"language":"json","code":"{\n  \"name\" : \"New environment\",\n  \"key\" : \"new-environment\",\n  \"color\": \"C8C8C8\"\n}"}]},"params":[{"_id":"57be2db3cb27950e00ceee18","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57be2e6fc248140e00858159","ref":"","in":"body","required":true,"desc":"The name of the new environment","default":"","type":"string","name":"name"},{"_id":"57be2e6fc248140e00858158","ref":"","in":"body","required":true,"desc":"A project-unique key for the new environment","default":"","type":"string","name":"key"},{"_id":"57be2e6fc248140e00858157","ref":"","in":"body","required":true,"desc":"A color swatch (as an RGB hex value with no leading '#', e.g. C8C8C8)","default":"","type":"string","name":"color"},{"_id":"57be2e6fc248140e00858156","ref":"","in":"body","required":false,"desc":"The default TTL for the new environment","default":"","type":"int","name":"defaultTtl"}],"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"_links\": {\n    },\n    \"_id\": \"57ae15fc40cda6071f6c242e\",\n    \"key\": \"production\",\n    \"name\": \"Production\",\n    \"apiKey\": \"XXX\",\n    \"mobileKey\": \"XXX\",\n    \"color\": \"417505\",\n    \"defaultTtl\": 0,\n    \"secureMode\": false\n}","name":""},{"status":400,"language":"json","code":"{\n  \"message\": \"Missing field name\"\n}","name":""},{"code":"{\n  \"message\": \"Account already has an environment with that key\"\n}","language":"text","status":409},{"status":403,"language":"json","code":"{\n  \"message\": \"You cannot create more than two environments.\"\n}"}]},"settings":"57be2876ddc0880e006f3b4d","url":"/projects/:projKey/environments"},"body":"Create a new environment in a specified project with a given name, key, swatch color, and default TTL.","category":"578d6fd021c6a81900ba272e","createdAt":"2016-08-24T23:27:56.201Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"create-environment","sync_unique":"","title":"Create environment","type":"post","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

postCreate environment


Path Params

projKey:
required
string
The project key

Body Params

name:
required
string
The name of the new environment
key:
required
string
A project-unique key for the new environment
color:
required
string
A color swatch (as an RGB hex value with no leading '#', e.g. C8C8C8)
defaultTtl:
integer
The default TTL for the new environment
Create a new environment in a specified project with a given name, key, swatch color, and default TTL.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Create a new environment in a specified project with a given name, key, swatch color, and default TTL.
{"__v":0,"_id":"57be3480ddc0880e006f3b56","api":{"examples":{"codes":[]},"results":{"codes":[{"status":204,"language":"json","code":"","name":""},{"status":404,"language":"json","code":"{}","name":""}]},"settings":"57be249fddc0880e006f3b4a","auth":"required","params":[{"_id":"57be3480ddc0880e006f3b58","ref":"","in":"path","required":false,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57be3480ddc0880e006f3b57","ref":"","in":"path","required":false,"desc":"The environment key","default":"","type":"string","name":"envKey"}],"url":"/projects/:projKey/environments/:envKey"},"body":"Delete an environment in a specified project.","category":"578d6fd021c6a81900ba272e","createdAt":"2016-08-24T23:57:52.967Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"delete-environment","sync_unique":"","title":"Delete environment","type":"delete","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

deleteDelete environment


Path Params

projKey:
string
The project key
envKey:
string
The environment key
Delete an environment in a specified project.

User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}


Delete an environment in a specified project.
{"__v":1,"_id":"57be6eb4b01e580e0043c613","api":{"auth":"required","examples":{"codes":[{"language":"json","code":"[\n  {\"op\": \"replace\", \"path\": \"/secureMode\", \"value\": true} \n]"}]},"params":[{"_id":"57be6f6afd5b9d0e00c551cc","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57be6f6afd5b9d0e00c551cb","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"}],"results":{"codes":[{"name":"","code":"{\n  \"_links\": {\n  },\n  \"_id\": \"573e20c78101c4070f00001d\",\n  \"key\": \"sample\",\n  \"name\": \"Sample Env\",\n  \"apiKey\": \"XXX\",\n  \"mobileKey\": \"XXX\",\n  \"color\": \"341d27\",\n  \"defaultTtl\": 3,\n  \"secureMode\": true\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"57be24d969196d0e00d0b5de","url":"/projects/:projKey/environments/:envKey"},"body":"","category":"578d6fd021c6a81900ba272e","createdAt":"2016-08-25T04:06:12.105Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"update-environment","sync_unique":"","title":"Update environment","type":"patch","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

patchUpdate environment


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key

User Information

Try It Out


patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



{"__v":0,"_id":"571fb615d9baf12900c62a20","api":{"auth":"required","params":[],"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Anatomy of a feature flag\"\n}\n[/block]\nThe feature flag API allows you to control percentage rollouts, target specific users, or even hit the 'kill' switch for a feature programmatically. By looking at the representation of a feature flag, we can see how to do any of these tasks.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Sample feature flag representation\",\n  \"sidebar\": true\n}\n[/block]\nEvery feature flag has a set of top-level attributes, as well as an `environments` map containing the flag rollout and targeting rules specific to each environment. Top-level attributes include things like the flag's name, description, tags, and creation date.\n\nFor reference, here's a complete feature flag representation. We'll be breaking this down and explaining each attribute in detail.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"name\\\": \\\"Alternate product page\\\",\\n  \\\"kind\\\": \\\"boolean\\\",\\n  \\\"description\\\": \\\"This is a description\\\",\\n  \\\"key\\\": \\\"alternate.page\\\",\\n  \\\"creationDate\\\": 1418684722483,\\n  \\\"includeInSnippet\\\": true,\\n  \\\"variations\\\": [\\n    {\\n      \\\"value\\\": true,\\n      \\\"name\\\": \\\"true\\\"\\n    },\\n    {\\n      \\\"value\\\": false,\\n      \\\"name\\\": \\\"false\\\"\\n    }\\n  ],\\n  \\\"temporary\\\": false,\\n  \\\"tags\\\": [\\n    \\\"ops\\\",\\n    \\\"experiments\\\"\\n  ],\\n  \\\"_links\\\": {\\n    \\\"parent\\\": {\\n      \\\"href\\\": \\\"/api/v2/flags/default\\\",\\n      \\\"type\\\": \\\"application/json\\\"\\n    },\\n    \\\"self\\\": {\\n      \\\"href\\\": \\\"/api/v2/flags/default/alternate.page\\\",\\n      \\\"type\\\": \\\"application/json\\\"\\n    }\\n  },\\n  \\\"maintainerId\\\": \\\"548f6741c1efad40031b18ae\\\",\\n  \\\"_maintainer\\\": {\\n    \\\"_links\\\": {\\n      \\\"parent\\\": {\\n        \\\"href\\\": \\\"/internal/account/members\\\",\\n        \\\"type\\\": \\\"application/json\\\"\\n      },\\n      \\\"self\\\": {\\n        \\\"href\\\": \\\"/internal/account/members/548f6741c1efad40031b18ae\\\",\\n        \\\"type\\\": \\\"application/json\\\"\\n      }\\n    },\\n    \\\"_id\\\": \\\"548f6741c1efad40031b18ae\\\",\\n    \\\"firstName\\\": \\\"Reese\\\",\\n    \\\"lastName\\\": \\\"App\\\",\\n    \\\"role\\\": \\\"owner\\\",\\n    \\\"email\\\": \\\"refapp@launchdarkly.com\\\",\\n    \\\"_pendingInvite\\\": false,\\n    \\\"isBeta\\\": false,\\n    \\\"customRoles\\\": []\\n  },\\n  \\\"goalIds\\\": [],\\n  \\\"environments\\\": {\\n    \\\"production\\\": {\\n      \\\"on\\\": true,\\n      \\\"archived\\\": false,\\n      \\\"salt\\\": \\\"YWx0ZXJuYXRlLnBhZ2U=\\\",\\n      \\\"sel\\\": \\\"45501b9314dc4641841af774cb038b96\\\",\\n      \\\"lastModified\\\": 1469326565348,\\n      \\\"version\\\": 61,\\n      \\\"targets\\\": [\\n        {\\n          \\\"values\\\": [\\n            \\\"1461797806427-7-115540266\\\"\\n          ],\\n          \\\"variation\\\": 0\\n        },\\n        {\\n          \\\"values\\\": [\\n            \\\"Gerhard.Little@yahoo.com\\\"\\n          ],\\n          \\\"variation\\\": 1\\n        }\\n      ],\\n      \\\"rules\\\": [\\n        {\\n          \\\"variation\\\": 0,\\n          \\\"clauses\\\": [\\n            {\\n              \\\"attribute\\\": \\\"groups\\\",\\n              \\\"op\\\": \\\"in\\\",\\n              \\\"values\\\": [\\n                \\\"Top Customers\\\"\\n              ],\\n              \\\"negate\\\": false\\n            },\\n            {\\n              \\\"attribute\\\": \\\"email\\\",\\n              \\\"op\\\": \\\"endsWith\\\",\\n              \\\"values\\\": [\\n                \\\"gmail.com\\\"\\n              ],\\n              \\\"negate\\\": false\\n            }\\n          ]\\n        }\\n      ],\\n      \\\"fallthrough\\\": {\\n        \\\"rollout\\\": {\\n          \\\"variations\\\": [\\n            {\\n              \\\"variation\\\": 0,\\n              \\\"weight\\\": 60000\\n            },\\n            {\\n              \\\"variation\\\": 1,\\n              \\\"weight\\\": 40000\\n            }\\n          ]\\n        }\\n      },\\n      \\\"offVariation\\\": 1,\\n      \\\"prerequisites\\\": [],\\n      \\\"_site\\\": {\\n        \\\"href\\\": \\\"/default/production/features/alternate.page\\\",\\n        \\\"type\\\": \\\"text/html\\\"\\n      }\\n    },\\n    \\\"test\\\": {\\n      \\\"on\\\": true,\\n      \\\"archived\\\": false,\\n      \\\"salt\\\": \\\"YWx0ZXJuYXRlLnBhZ2U=\\\",\\n      \\\"sel\\\": \\\"76c63094d35949bb9dc9bd5c570bacf5\\\",\\n      \\\"lastModified\\\": 1455145480896,\\n      \\\"version\\\": 37,\\n      \\\"targets\\\": [\\n        {\\n          \\\"values\\\": [],\\n          \\\"variation\\\": 0\\n        },\\n        {\\n          \\\"values\\\": [],\\n          \\\"variation\\\": 1\\n        }\\n      ],\\n      \\\"rules\\\": [],\\n      \\\"fallthrough\\\": {\\n        \\\"rollout\\\": {\\n          \\\"variations\\\": [\\n            {\\n              \\\"variation\\\": 0,\\n              \\\"weight\\\": 49000\\n            },\\n            {\\n              \\\"variation\\\": 1,\\n              \\\"weight\\\": 51000\\n            }\\n          ]\\n        }\\n      },\\n      \\\"prerequisites\\\": [],\\n      \\\"_site\\\": {\\n        \\\"href\\\": \\\"/default/tester/features/alternate.page\\\",\\n        \\\"type\\\": \\\"text/html\\\"\\n      }\\n    }\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Sample feature flag representation\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Top-level attributes\"\n}\n[/block]\nMost of the top-level attributes have a straightforward interpretation. For example, to change the name of a feature, simply [update the feature flag](doc:update-feature-flag) with the `name` attribute set to the new name:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  {\\\"op\\\": \\\"replace\\\", \\\"path\\\": \\\"/name\\\", \\\"value\\\": \\\"New name\\\"}\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe `variations` array is worth calling out. This array represents the different variation values that a feature flag has. For a boolean flag, there are two variations-- `true` and `false`. Multivariate flags will have more variation values, and those values could be any JSON type (numbers, strings, objects, or arrays). In targeting rules, the variations are referred to by their index into this array. This will be clearer below when we look at some specific examples.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Per-environment configurations\"\n}\n[/block]\nEach entry in the `environments` map contains a JSON object that represents the environment-specific flag configuration data that you see on the [Targeting](http://docs.launchdarkly.com/v2.0/docs/targeting-users) tab of your Manage Feature page. For example, to toggle the kill switch for a feature flag in your production environment, use the following JSON patch operation:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  {\\\"op\\\": \\\"replace\\\", \\\"path\\\": \\\"/environments/production/on\\\", \\\"value\\\": false}\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nEach section of the Targeting tab corresponds to a different attribute of the per-environment configuration data, as shown here:\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Individual user targets\"\n}\n[/block]\nThe `targets` array in the per-environment configuration data represents the individual user targeting rules on the Targeting tab. Each object in the `targets` array represents a list of user keys assigned to a particular variation. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  ...\\n  \\\"environments\\\" : {\\n\\t\\t\\\"production\\\" : {\\n\\t\\t\\t...\\n  \\t\\t\\\"targets\\\": [\\n  \\t\\t\\t{\\n  \\t\\t\\t\\t\\\"values\\\": [\\\"foo@example.com\\\"],\\n  \\t\\t\\t\\t\\\"variation: 0\\n\\t\\t\\t\\t}\\n  \\t\\t]\\n\\t\\t}\\n\\t}\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThis `targets` array here means that user `foo@example.com` should receive the first variation listed in the `variations` array (recall that the variations are stored at the top level of the flag JSON in an array, and the per-environment configuration rules point to indexes into this array). If this is a boolean flag, that means that `foo@example.com` is receiving the `true` variation.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Targeting rules\"\n}\n[/block]\nThe `rules` array corresponds to the custom targeting rules section of the Targeting tab. This is where you can express complex rules on attributes with conditions and operators. For example, a rule like \"roll the `true` variation out to 80% of users whose e-mail address ends with `gmail.com` would be expressed here.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"The fallthrough rule\"\n}\n[/block]\nThe `fallthrough` object is a special rule that contains no conditions-- it is the rollout strategy that is applied when none of the individual or custom targeting rules match.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"The off variation\"\n}\n[/block]\nThe off variation represents the variation to serve if the feature flag is killed (the `on` attribute is `false`). For boolean flags, this is usually `false`. For multivariate flags, set the off variation to whatever variation represents the control or baseline behavior for your application. If you don't set the off variation, LaunchDarkly will serve the fallback value defined in your code.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Percentage rollouts\"\n}\n[/block]\nThe `weight` attribute defines the percentage rollout for each variation. Weights range from 0 (0% rollout) to 100000 (a 100% rollout). The weights are scaled by a factor of 1000 so that fractions of a percent can be represented without using floating point-- so a weight of `50000` means that 50% of users (that don't otherwise match any `targets`, see above) will see that variation. The sum of weights across all variations should be 100%.","category":"571fb615d9baf12900c62a16","createdAt":"2014-12-19T18:15:12.584Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"feature-flags-overview","sync_unique":"","title":"Feature flags overview","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Feature flags overview


[block:api-header] { "type": "basic", "title": "Anatomy of a feature flag" } [/block] The feature flag API allows you to control percentage rollouts, target specific users, or even hit the 'kill' switch for a feature programmatically. By looking at the representation of a feature flag, we can see how to do any of these tasks. [block:api-header] { "type": "basic", "title": "Sample feature flag representation", "sidebar": true } [/block] Every feature flag has a set of top-level attributes, as well as an `environments` map containing the flag rollout and targeting rules specific to each environment. Top-level attributes include things like the flag's name, description, tags, and creation date. For reference, here's a complete feature flag representation. We'll be breaking this down and explaining each attribute in detail. [block:code] { "codes": [ { "code": "{\n \"name\": \"Alternate product page\",\n \"kind\": \"boolean\",\n \"description\": \"This is a description\",\n \"key\": \"alternate.page\",\n \"creationDate\": 1418684722483,\n \"includeInSnippet\": true,\n \"variations\": [\n {\n \"value\": true,\n \"name\": \"true\"\n },\n {\n \"value\": false,\n \"name\": \"false\"\n }\n ],\n \"temporary\": false,\n \"tags\": [\n \"ops\",\n \"experiments\"\n ],\n \"_links\": {\n \"parent\": {\n \"href\": \"/api/v2/flags/default\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/v2/flags/default/alternate.page\",\n \"type\": \"application/json\"\n }\n },\n \"maintainerId\": \"548f6741c1efad40031b18ae\",\n \"_maintainer\": {\n \"_links\": {\n \"parent\": {\n \"href\": \"/internal/account/members\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n \"type\": \"application/json\"\n }\n },\n \"_id\": \"548f6741c1efad40031b18ae\",\n \"firstName\": \"Reese\",\n \"lastName\": \"App\",\n \"role\": \"owner\",\n \"email\": \"refapp@launchdarkly.com\",\n \"_pendingInvite\": false,\n \"isBeta\": false,\n \"customRoles\": []\n },\n \"goalIds\": [],\n \"environments\": {\n \"production\": {\n \"on\": true,\n \"archived\": false,\n \"salt\": \"YWx0ZXJuYXRlLnBhZ2U=\",\n \"sel\": \"45501b9314dc4641841af774cb038b96\",\n \"lastModified\": 1469326565348,\n \"version\": 61,\n \"targets\": [\n {\n \"values\": [\n \"1461797806427-7-115540266\"\n ],\n \"variation\": 0\n },\n {\n \"values\": [\n \"Gerhard.Little@yahoo.com\"\n ],\n \"variation\": 1\n }\n ],\n \"rules\": [\n {\n \"variation\": 0,\n \"clauses\": [\n {\n \"attribute\": \"groups\",\n \"op\": \"in\",\n \"values\": [\n \"Top Customers\"\n ],\n \"negate\": false\n },\n {\n \"attribute\": \"email\",\n \"op\": \"endsWith\",\n \"values\": [\n \"gmail.com\"\n ],\n \"negate\": false\n }\n ]\n }\n ],\n \"fallthrough\": {\n \"rollout\": {\n \"variations\": [\n {\n \"variation\": 0,\n \"weight\": 60000\n },\n {\n \"variation\": 1,\n \"weight\": 40000\n }\n ]\n }\n },\n \"offVariation\": 1,\n \"prerequisites\": [],\n \"_site\": {\n \"href\": \"/default/production/features/alternate.page\",\n \"type\": \"text/html\"\n }\n },\n \"test\": {\n \"on\": true,\n \"archived\": false,\n \"salt\": \"YWx0ZXJuYXRlLnBhZ2U=\",\n \"sel\": \"76c63094d35949bb9dc9bd5c570bacf5\",\n \"lastModified\": 1455145480896,\n \"version\": 37,\n \"targets\": [\n {\n \"values\": [],\n \"variation\": 0\n },\n {\n \"values\": [],\n \"variation\": 1\n }\n ],\n \"rules\": [],\n \"fallthrough\": {\n \"rollout\": {\n \"variations\": [\n {\n \"variation\": 0,\n \"weight\": 49000\n },\n {\n \"variation\": 1,\n \"weight\": 51000\n }\n ]\n }\n },\n \"prerequisites\": [],\n \"_site\": {\n \"href\": \"/default/tester/features/alternate.page\",\n \"type\": \"text/html\"\n }\n }\n }\n}", "language": "json", "name": "Sample feature flag representation" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Top-level attributes" } [/block] Most of the top-level attributes have a straightforward interpretation. For example, to change the name of a feature, simply [update the feature flag](doc:update-feature-flag) with the `name` attribute set to the new name: [block:code] { "codes": [ { "code": "[\n {\"op\": \"replace\", \"path\": \"/name\", \"value\": \"New name\"}\n]", "language": "json" } ] } [/block] The `variations` array is worth calling out. This array represents the different variation values that a feature flag has. For a boolean flag, there are two variations-- `true` and `false`. Multivariate flags will have more variation values, and those values could be any JSON type (numbers, strings, objects, or arrays). In targeting rules, the variations are referred to by their index into this array. This will be clearer below when we look at some specific examples. [block:api-header] { "type": "basic", "title": "Per-environment configurations" } [/block] Each entry in the `environments` map contains a JSON object that represents the environment-specific flag configuration data that you see on the [Targeting](http://docs.launchdarkly.com/v2.0/docs/targeting-users) tab of your Manage Feature page. For example, to toggle the kill switch for a feature flag in your production environment, use the following JSON patch operation: [block:code] { "codes": [ { "code": "[\n {\"op\": \"replace\", \"path\": \"/environments/production/on\", \"value\": false}\n]", "language": "json" } ] } [/block] Each section of the Targeting tab corresponds to a different attribute of the per-environment configuration data, as shown here: [block:api-header] { "type": "basic", "title": "Individual user targets" } [/block] The `targets` array in the per-environment configuration data represents the individual user targeting rules on the Targeting tab. Each object in the `targets` array represents a list of user keys assigned to a particular variation. For example: [block:code] { "codes": [ { "code": "{\n ...\n \"environments\" : {\n\t\t\"production\" : {\n\t\t\t...\n \t\t\"targets\": [\n \t\t\t{\n \t\t\t\t\"values\": [\"foo@example.com\"],\n \t\t\t\t\"variation: 0\n\t\t\t\t}\n \t\t]\n\t\t}\n\t}\n}\n", "language": "json" } ] } [/block] This `targets` array here means that user `foo@example.com` should receive the first variation listed in the `variations` array (recall that the variations are stored at the top level of the flag JSON in an array, and the per-environment configuration rules point to indexes into this array). If this is a boolean flag, that means that `foo@example.com` is receiving the `true` variation. [block:api-header] { "type": "basic", "title": "Targeting rules" } [/block] The `rules` array corresponds to the custom targeting rules section of the Targeting tab. This is where you can express complex rules on attributes with conditions and operators. For example, a rule like "roll the `true` variation out to 80% of users whose e-mail address ends with `gmail.com` would be expressed here. [block:api-header] { "type": "basic", "title": "The fallthrough rule" } [/block] The `fallthrough` object is a special rule that contains no conditions-- it is the rollout strategy that is applied when none of the individual or custom targeting rules match. [block:api-header] { "type": "basic", "title": "The off variation" } [/block] The off variation represents the variation to serve if the feature flag is killed (the `on` attribute is `false`). For boolean flags, this is usually `false`. For multivariate flags, set the off variation to whatever variation represents the control or baseline behavior for your application. If you don't set the off variation, LaunchDarkly will serve the fallback value defined in your code. [block:api-header] { "type": "basic", "title": "Percentage rollouts" } [/block] The `weight` attribute defines the percentage rollout for each variation. Weights range from 0 (0% rollout) to 100000 (a 100% rollout). The weights are scaled by a factor of 1000 so that fractions of a percent can be represented without using floating point-- so a weight of `50000` means that 50% of users (that don't otherwise match any `targets`, see above) will see that variation. The sum of weights across all variations should be 100%.
[block:api-header] { "type": "basic", "title": "Anatomy of a feature flag" } [/block] The feature flag API allows you to control percentage rollouts, target specific users, or even hit the 'kill' switch for a feature programmatically. By looking at the representation of a feature flag, we can see how to do any of these tasks. [block:api-header] { "type": "basic", "title": "Sample feature flag representation", "sidebar": true } [/block] Every feature flag has a set of top-level attributes, as well as an `environments` map containing the flag rollout and targeting rules specific to each environment. Top-level attributes include things like the flag's name, description, tags, and creation date. For reference, here's a complete feature flag representation. We'll be breaking this down and explaining each attribute in detail. [block:code] { "codes": [ { "code": "{\n \"name\": \"Alternate product page\",\n \"kind\": \"boolean\",\n \"description\": \"This is a description\",\n \"key\": \"alternate.page\",\n \"creationDate\": 1418684722483,\n \"includeInSnippet\": true,\n \"variations\": [\n {\n \"value\": true,\n \"name\": \"true\"\n },\n {\n \"value\": false,\n \"name\": \"false\"\n }\n ],\n \"temporary\": false,\n \"tags\": [\n \"ops\",\n \"experiments\"\n ],\n \"_links\": {\n \"parent\": {\n \"href\": \"/api/v2/flags/default\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/v2/flags/default/alternate.page\",\n \"type\": \"application/json\"\n }\n },\n \"maintainerId\": \"548f6741c1efad40031b18ae\",\n \"_maintainer\": {\n \"_links\": {\n \"parent\": {\n \"href\": \"/internal/account/members\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n \"type\": \"application/json\"\n }\n },\n \"_id\": \"548f6741c1efad40031b18ae\",\n \"firstName\": \"Reese\",\n \"lastName\": \"App\",\n \"role\": \"owner\",\n \"email\": \"refapp@launchdarkly.com\",\n \"_pendingInvite\": false,\n \"isBeta\": false,\n \"customRoles\": []\n },\n \"goalIds\": [],\n \"environments\": {\n \"production\": {\n \"on\": true,\n \"archived\": false,\n \"salt\": \"YWx0ZXJuYXRlLnBhZ2U=\",\n \"sel\": \"45501b9314dc4641841af774cb038b96\",\n \"lastModified\": 1469326565348,\n \"version\": 61,\n \"targets\": [\n {\n \"values\": [\n \"1461797806427-7-115540266\"\n ],\n \"variation\": 0\n },\n {\n \"values\": [\n \"Gerhard.Little@yahoo.com\"\n ],\n \"variation\": 1\n }\n ],\n \"rules\": [\n {\n \"variation\": 0,\n \"clauses\": [\n {\n \"attribute\": \"groups\",\n \"op\": \"in\",\n \"values\": [\n \"Top Customers\"\n ],\n \"negate\": false\n },\n {\n \"attribute\": \"email\",\n \"op\": \"endsWith\",\n \"values\": [\n \"gmail.com\"\n ],\n \"negate\": false\n }\n ]\n }\n ],\n \"fallthrough\": {\n \"rollout\": {\n \"variations\": [\n {\n \"variation\": 0,\n \"weight\": 60000\n },\n {\n \"variation\": 1,\n \"weight\": 40000\n }\n ]\n }\n },\n \"offVariation\": 1,\n \"prerequisites\": [],\n \"_site\": {\n \"href\": \"/default/production/features/alternate.page\",\n \"type\": \"text/html\"\n }\n },\n \"test\": {\n \"on\": true,\n \"archived\": false,\n \"salt\": \"YWx0ZXJuYXRlLnBhZ2U=\",\n \"sel\": \"76c63094d35949bb9dc9bd5c570bacf5\",\n \"lastModified\": 1455145480896,\n \"version\": 37,\n \"targets\": [\n {\n \"values\": [],\n \"variation\": 0\n },\n {\n \"values\": [],\n \"variation\": 1\n }\n ],\n \"rules\": [],\n \"fallthrough\": {\n \"rollout\": {\n \"variations\": [\n {\n \"variation\": 0,\n \"weight\": 49000\n },\n {\n \"variation\": 1,\n \"weight\": 51000\n }\n ]\n }\n },\n \"prerequisites\": [],\n \"_site\": {\n \"href\": \"/default/tester/features/alternate.page\",\n \"type\": \"text/html\"\n }\n }\n }\n}", "language": "json", "name": "Sample feature flag representation" } ], "sidebar": true } [/block] [block:api-header] { "type": "basic", "title": "Top-level attributes" } [/block] Most of the top-level attributes have a straightforward interpretation. For example, to change the name of a feature, simply [update the feature flag](doc:update-feature-flag) with the `name` attribute set to the new name: [block:code] { "codes": [ { "code": "[\n {\"op\": \"replace\", \"path\": \"/name\", \"value\": \"New name\"}\n]", "language": "json" } ] } [/block] The `variations` array is worth calling out. This array represents the different variation values that a feature flag has. For a boolean flag, there are two variations-- `true` and `false`. Multivariate flags will have more variation values, and those values could be any JSON type (numbers, strings, objects, or arrays). In targeting rules, the variations are referred to by their index into this array. This will be clearer below when we look at some specific examples. [block:api-header] { "type": "basic", "title": "Per-environment configurations" } [/block] Each entry in the `environments` map contains a JSON object that represents the environment-specific flag configuration data that you see on the [Targeting](http://docs.launchdarkly.com/v2.0/docs/targeting-users) tab of your Manage Feature page. For example, to toggle the kill switch for a feature flag in your production environment, use the following JSON patch operation: [block:code] { "codes": [ { "code": "[\n {\"op\": \"replace\", \"path\": \"/environments/production/on\", \"value\": false}\n]", "language": "json" } ] } [/block] Each section of the Targeting tab corresponds to a different attribute of the per-environment configuration data, as shown here: [block:api-header] { "type": "basic", "title": "Individual user targets" } [/block] The `targets` array in the per-environment configuration data represents the individual user targeting rules on the Targeting tab. Each object in the `targets` array represents a list of user keys assigned to a particular variation. For example: [block:code] { "codes": [ { "code": "{\n ...\n \"environments\" : {\n\t\t\"production\" : {\n\t\t\t...\n \t\t\"targets\": [\n \t\t\t{\n \t\t\t\t\"values\": [\"foo@example.com\"],\n \t\t\t\t\"variation: 0\n\t\t\t\t}\n \t\t]\n\t\t}\n\t}\n}\n", "language": "json" } ] } [/block] This `targets` array here means that user `foo@example.com` should receive the first variation listed in the `variations` array (recall that the variations are stored at the top level of the flag JSON in an array, and the per-environment configuration rules point to indexes into this array). If this is a boolean flag, that means that `foo@example.com` is receiving the `true` variation. [block:api-header] { "type": "basic", "title": "Targeting rules" } [/block] The `rules` array corresponds to the custom targeting rules section of the Targeting tab. This is where you can express complex rules on attributes with conditions and operators. For example, a rule like "roll the `true` variation out to 80% of users whose e-mail address ends with `gmail.com` would be expressed here. [block:api-header] { "type": "basic", "title": "The fallthrough rule" } [/block] The `fallthrough` object is a special rule that contains no conditions-- it is the rollout strategy that is applied when none of the individual or custom targeting rules match. [block:api-header] { "type": "basic", "title": "The off variation" } [/block] The off variation represents the variation to serve if the feature flag is killed (the `on` attribute is `false`). For boolean flags, this is usually `false`. For multivariate flags, set the off variation to whatever variation represents the control or baseline behavior for your application. If you don't set the off variation, LaunchDarkly will serve the fallback value defined in your code. [block:api-header] { "type": "basic", "title": "Percentage rollouts" } [/block] The `weight` attribute defines the percentage rollout for each variation. Weights range from 0 (0% rollout) to 100000 (a 100% rollout). The weights are scaled by a factor of 1000 so that fractions of a percent can be represented without using floating point-- so a weight of `50000` means that 50% of users (that don't otherwise match any `targets`, see above) will see that variation. The sum of weights across all variations should be 100%.
{"__v":2,"_id":"571fb615d9baf12900c62a21","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57c120c1d796900e0025001f","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57c120c1d796900e0025001e","ref":"","in":"query","required":false,"desc":"Filter configurations by environment","default":"","type":"string","name":"env"},{"_id":"58ab3317b435800f00c02cde","ref":"","in":"query","required":false,"desc":"Filter feature flags by tag","default":"","type":"string","name":"tag"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"items\": [\n    {\n      \"name\": \"Alternate product page\",\n      \"kind\": \"boolean\",\n      \"description\": \"This is a description\",\n      \"key\": \"alternate.page\",\n      \"creationDate\": 1418684722483,\n      \"includeInSnippet\": true,\n      \"variations\": [\n        {\n          \"value\": true,\n          \"name\": \"true\"\n        },\n        {\n          \"value\": false,\n          \"name\": \"false\"\n        }\n      ],\n      \"temporary\": false,\n      \"tags\": [\n        \"ops\",\n        \"experiments\"\n      ],\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/flags/default\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/flags/default/alternate.page\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"maintainerId\": \"548f6741c1efad40031b18ae\",\n      \"_maintainer\": {\n        \"_links\": {\n          \"parent\": {\n            \"href\": \"/internal/account/members\",\n            \"type\": \"application/json\"\n          },\n          \"self\": {\n            \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n            \"type\": \"application/json\"\n          }\n        },\n        \"_id\": \"548f6741c1efad40031b18ae\",\n        \"firstName\": \"Reese\",\n        \"lastName\": \"Applebaum\",\n        \"role\": \"owner\",\n        \"email\": \"refapp@launchdarkly.com\",\n        \"_pendingInvite\": false,\n        \"isBeta\": false,\n        \"customRoles\": []\n      },\n      \"goalIds\": [],\n      \"environments\": {\n        \"production\": {\n          \"on\": false,\n          \"archived\": false,\n          \"salt\": \"YWx0ZXJuYXRlLnBhZ2U=\",\n          \"sel\": \"45501b9314dc4641841af774cb038b96\",\n          \"lastModified\": 1469326565348,\n          \"version\": 65,\n          \"targets\": [\n            {\n              \"values\": [\n                \"1461797806427-7-115540266\",\n                \"00142875-a39d-4028-a3b7-987ccd151649\"\n              ],\n              \"variation\": 0\n            },\n            {\n              \"values\": [\n                \"Gerhard.Little@yahoo.com\"\n              ],\n              \"variation\": 1\n            }\n          ],\n          \"rules\": [\n            {\n              \"variation\": 0,\n              \"clauses\": [\n                {\n                  \"attribute\": \"groups\",\n                  \"op\": \"in\",\n                  \"values\": [\n                    \"Top Customers\"\n                  ],\n                  \"negate\": false\n                },\n                {\n                  \"attribute\": \"email\",\n                  \"op\": \"endsWith\",\n                  \"values\": [\n                    \"gmail.com\"\n                  ],\n                  \"negate\": false\n                },\n                {\n                  \"attribute\": \"lastName\",\n                  \"op\": \"in\",\n                  \"values\": [\n                    \"Baker\"\n                  ],\n                  \"negate\": false\n                }\n              ]\n            }\n          ],\n          \"fallthrough\": {\n            \"rollout\": {\n              \"variations\": [\n                {\n                  \"variation\": 0,\n                  \"weight\": 55000\n                },\n                {\n                  \"variation\": 1,\n                  \"weight\": 45000\n                }\n              ]\n            }\n          },\n          \"offVariation\": 1,\n          \"prerequisites\": [],\n          \"_site\": {\n            \"href\": \"/default/production/features/alternate.page\",\n            \"type\": \"text/html\"\n          }\n        }\n      }\n    },\n    {\n      \"name\": \"New dashboard\",\n      \"kind\": \"boolean\",\n      \"key\": \"new.dashboard.enable\",\n      \"creationDate\": 1419030416299,\n      \"includeInSnippet\": false,\n      \"variations\": [\n        {\n          \"value\": true,\n          \"name\": \"true\"\n        },\n        {\n          \"value\": false,\n          \"name\": \"false\"\n        }\n      ],\n      \"temporary\": false,\n      \"tags\": [],\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/flags/default\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/flags/default/new.dashboard.enable\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"goalIds\": [],\n      \"environments\": {\n        \"production\": {\n          \"on\": false,\n          \"archived\": false,\n          \"salt\": \"bmV3LmRhc2hib2FyZC5lbmFibGU=\",\n          \"sel\": \"a2a85b7d62614a769cd43e383a393336\",\n          \"lastModified\": 1467316590766,\n          \"version\": 37,\n          \"targets\": [\n            {\n              \"values\": [\n                \"Ernesto.Gidney@example.com\",\n                \"000d8dca-5c71-4de3-8405-16b219d07718\",\n                \"00045aff-915e-46ab-bd56-d0042688fa02\",\n                \"1461797806427-7-115540266\"\n              ],\n              \"variation\": 0\n            }\n          ],\n          \"rules\": [],\n          \"fallthrough\": {\n            \"variation\": 0\n          },\n          \"offVariation\": 1,\n          \"prerequisites\": [],\n          \"_site\": {\n            \"href\": \"/default/production/features/new.dashboard.enable\",\n            \"type\": \"text/html\"\n          }\n        }\n      }\n    }\n  ],\n  \"_links\": {\n    \"self\": {\n      \"href\": \"/api/v2/flags/default\",\n      \"type\": \"application/json\"\n    }\n  }\n}","name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/flags/:projKey"},"body":"Get a list of all features in the given project. By default, each feature will include configurations for each environment. You can filter environments with the `env` query parameter. For example, setting `env=production` will restrict the returned configurations to just your production environment. You can also filter feature flags by tag with the `tag` query parameter.","category":"571fb615d9baf12900c62a16","createdAt":"2014-12-17T21:03:59.938Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":1,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"list-feature-flags","sync_unique":"","title":"List feature flags","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getList feature flags


Path Params

projKey:
required
string
The project key

Query Params

env:
string
Filter configurations by environment
tag:
string
Filter feature flags by tag
Get a list of all features in the given project. By default, each feature will include configurations for each environment. You can filter environments with the `env` query parameter. For example, setting `env=production` will restrict the returned configurations to just your production environment. You can also filter feature flags by tag with the `tag` query parameter.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Get a list of all features in the given project. By default, each feature will include configurations for each environment. You can filter environments with the `env` query parameter. For example, setting `env=production` will restrict the returned configurations to just your production environment. You can also filter feature flags by tag with the `tag` query parameter.
{"__v":2,"_id":"571fb615d9baf12900c62a22","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57c1210bab303e0e0010735d","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"5491f2184311181600198e69","ref":"","in":"path","required":true,"desc":"The feature flag key","default":"","type":"string","name":"key"},{"_id":"57c1218f9244210e00e6ff0b","default":"","desc":"Filter configurations by environment","in":"query","name":"env","ref":"","required":false,"type":"string"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"name\": \"Alternate sort order\",\n  \"kind\": \"boolean\",\n  \"key\": \"sort.order\",\n  \"creationDate\": 1443652232590,\n  \"includeInSnippet\": false,\n  \"variations\": [\n    {\n      \"value\": true,\n      \"name\": \"true\"\n    },\n    {\n      \"value\": false,\n      \"name\": \"false\"\n    }\n  ],\n  \"temporary\": false,\n  \"tags\": [\n    \"th\"\n  ],\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/flags/default\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/flags/default/sort.order\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"maintainerId\": \"561c579cd8fd5c2704000001\",\n  \"_maintainer\": {\n    \"_links\": {\n      \"parent\": {\n        \"href\": \"/internal/account/members\",\n        \"type\": \"application/json\"\n      },\n      \"self\": {\n        \"href\": \"/internal/account/members/561c579cd8fd5c2704000001\",\n        \"type\": \"application/json\"\n      }\n    },\n    \"_id\": \"561c579cd8fd5c2704000001\",\n    \"firstName\": \"John\",\n    \"lastName\": \"Test\",\n    \"role\": \"reader\",\n    \"email\": \"john+test@launchdarkly.com\",\n    \"_pendingInvite\": false,\n    \"isBeta\": false,\n    \"customRoles\": [\n      \"569983b05a64a106b7000002\"\n    ]\n  },\n  \"goalIds\": [\n    \"567340e3846da0c33d6e1afd\",\n    \"567340e4846da0c33d6e1b05\"\n  ],\n  \"environments\": {\n    \"test\": {\n      \"on\": true,\n      \"archived\": false,\n      \"salt\": \"c29ydC5vcmRlcg==\",\n      \"sel\": \"fc724d64836544268660932f4ff8c7de\",\n      \"lastModified\": 1469316314506,\n      \"version\": 1,\n      \"targets\": [\n        {\n          \"values\": [],\n          \"variation\": 0\n        },\n        {\n          \"values\": [],\n          \"variation\": 1\n        }\n      ],\n      \"rules\": [],\n      \"fallthrough\": {\n        \"variation\": 1\n      },\n      \"prerequisites\": [],\n      \"_site\": {\n        \"href\": \"/default/test/features/sort.order\",\n        \"type\": \"text/html\"\n      }\n    },\n    \"production\": {\n      \"on\": true,\n      \"archived\": false,\n      \"salt\": \"c29ydC5vcmRlcg==\",\n      \"sel\": \"8de1085cb7354b0ab41c0e778376dfd3\",\n      \"lastModified\": 1469131558260,\n      \"version\": 81,\n      \"targets\": [\n        {\n          \"values\": [\n            \"Gerhard.Little@yahoo.com\"\n          ],\n          \"variation\": 0\n        },\n        {\n          \"values\": [\n            \"1461797806429-33-861961230\",\n            \"1461797806426-2--1056309393\"\n          ],\n          \"variation\": 1\n        }\n      ],\n      \"rules\": [],\n      \"fallthrough\": {\n        \"variation\": 0\n      },\n      \"offVariation\": 1,\n      \"prerequisites\": [],\n      \"_site\": {\n        \"href\": \"/default/production/features/sort.order\",\n        \"type\": \"text/html\"\n      }\n    }\n  }\n}","name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/flags/:projKey/:key"},"body":"Get a single feature flag by key. By default, the configurations for all environments will be returned. You can filter environments with the `env` query parameter. For example, setting `env=production` will restrict the returned configurations to just your production environment.","category":"571fb615d9baf12900c62a16","createdAt":"2014-12-17T21:14:00.819Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"get-feature-flag","sync_unique":"","title":"Get feature flag","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getGet feature flag


Path Params

projKey:
required
string
The project key
key:
required
string
The feature flag key

Query Params

env:
string
Filter configurations by environment
Get a single feature flag by key. By default, the configurations for all environments will be returned. You can filter environments with the `env` query parameter. For example, setting `env=production` will restrict the returned configurations to just your production environment.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Get a single feature flag by key. By default, the configurations for all environments will be returned. You can filter environments with the `env` query parameter. For example, setting `env=production` will restrict the returned configurations to just your production environment.
{"__v":5,"_id":"571fb615d9baf12900c62a23","api":{"auth":"required","examples":{"codes":[{"language":"json","code":"{\n  \"name\": \"New test flag\",\n  \"key\": \"new-test-flag\",\n  \"description\": \"New description\",\n  \"variations\": [\n    {\n      \"value\": true,\n      \"name\": \"True\",\n      \"description\": \"The true variation\"\n    },\n    {\n      \"value\": false,\n      \"name\": \"False\",\n      \"description\": \"The false variation\"\n    }\n  ],\n  \"includeInSnippet\": false,\n  \"temporary\": true,\n  \"tags\": []\n}"}]},"params":[{"_id":"549250daccf2070b002a17ed","ref":"","in":"body","required":true,"desc":"A human-friendly name for the feature flag","default":"","type":"string","name":"name"},{"_id":"549250daccf2070b002a17ec","ref":"","in":"body","required":true,"desc":"A unique key that will be used to reference the flag in your code","default":"","type":"string","name":"key"},{"_id":"549250daccf2070b002a17ea","ref":"","in":"body","required":true,"desc":"An array of possible variations for the flag.","default":"","type":"array_object","name":"variations"},{"_id":"549250daccf2070b002a17e9","ref":"","in":"body","required":true,"desc":"The value of the flag for this variation","default":"","type":"mixed","name":"variations[value]"},{"_id":"549250daccf2070b002a17e8","ref":"","in":"body","required":false,"desc":"A description for the variation","default":"","type":"string","name":"variations[description]"},{"_id":"54949a475051740b00ab7d41","ref":"","in":"body","required":false,"desc":"A name for the variation","default":"","type":"array_mixed","name":"variations[name]"},{"_id":"57c12242a3ba0b0e00eb11e1","ref":"","in":"path","required":false,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57c122e8d796900e00250022","ref":"","in":"body","required":false,"desc":"Whether or not the flag is a temporary flag","default":"","type":"boolean","name":"temporary"},{"_id":"57c122e8d796900e00250021","ref":"","in":"body","required":false,"desc":"Tags for the feature flag","default":"","type":"array_string","name":"tags"},{"_id":"57c12324c3c39d0e00376a2f","ref":"","in":"body","required":false,"desc":"Whether or not this flag should be made available to the client-side JavaScript SDK","default":"","type":"boolean","name":"includeInSnippet"}],"results":{"codes":[{"name":"","code":"{\n   \"name\":\"New test flag\",\n   \"key\":\"new-test-flag\",\n   \"on\":true,\n  ...\n}","language":"json","status":201},{"name":null,"code":"{\n  \"message\": \"Duplicate feature key\"\n}","language":"json","status":409}]},"settings":"57be2876ddc0880e006f3b4d","url":"/flags/:projKey"},"body":"Creates a new feature flag.","category":"571fb615d9baf12900c62a16","createdAt":"2014-12-18T03:58:18.917Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"create-feature-flag","sync_unique":"","title":"Create feature flag","type":"post","updates":["582dd4f70adc11230047890e"],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

postCreate feature flag


Path Params

projKey:
string
The project key

Body Params

name:
required
string
A human-friendly name for the feature flag
key:
required
string
A unique key that will be used to reference the flag in your code
variations:
required
array of objects
An array of possible variations for the flag.
variations[value]:
required
mixed
The value of the flag for this variation
variations[description]:
string
A description for the variation
variations[name]:
array of mixed
A name for the variation
temporary:
boolean
Whether or not the flag is a temporary flag
tags:
array of strings
Tags for the feature flag
includeInSnippet:
boolean
Whether or not this flag should be made available to the client-side JavaScript SDK
Creates a new feature flag.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Creates a new feature flag.
{"__v":1,"_id":"571fb615d9baf12900c62a24","api":{"auth":"required","examples":{"codes":[{"language":"json","code":"[\n  { \"op\": \"replace\", \"path\": \"/environments/production/on\", \"value\": false }\n]"}]},"params":[{"_id":"57c121ecd796900e00250020","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"54925371f0d1810b0065ffc9","ref":"","in":"path","required":true,"desc":"The key of the feature flag to be updated","default":"","type":"string","name":"key"}],"results":{"codes":[{"name":"","code":"{\n   \"name\":\"Alternate sort order\",\n   \"key\":\"sort.order\",\n   \"on\":true,\n  ...\n}","language":"json","status":200},{"name":"","code":"{\n  \"message\": \"Invalid json-patch document\"\n}","language":"json","status":400}]},"settings":"57be24d969196d0e00d0b5de","url":"/flags/:projKey/:key"},"body":"Perform a partial update to a feature. The request body must be a valid [JSON Patch](https://tools.ietf.org/html/rfc6902) document.","category":"571fb615d9baf12900c62a16","createdAt":"2014-12-18T04:09:21.470Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"update-feature-flag","sync_unique":"","title":"Update feature flag","type":"patch","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

patchUpdate feature flag


Path Params

projKey:
required
string
The project key
key:
required
string
The key of the feature flag to be updated
Perform a partial update to a feature. The request body must be a valid [JSON Patch](https://tools.ietf.org/html/rfc6902) document.

User Information

Try It Out


patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Perform a partial update to a feature. The request body must be a valid [JSON Patch](https://tools.ietf.org/html/rfc6902) document.
{"__v":2,"_id":"571fb615d9baf12900c62a25","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57c121baab303e0e0010735e","ref":"","in":"path","required":false,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"54925320ccf2070b002a17ef","ref":"","in":"path","required":true,"desc":"The key of the feature flag to delete","default":"","type":"string","name":"key"}],"results":{"codes":[{"name":"","code":"","language":"json","status":204}]},"settings":"57be249fddc0880e006f3b4a","url":"/flags/:projKey/:key"},"body":"Delete a feature flag in **all** environments. Be careful-- only delete feature flags that are no longer being used by your application.","category":"571fb615d9baf12900c62a16","createdAt":"2014-12-18T04:08:00.484Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":5,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"delete-feature-flag","sync_unique":"","title":"Delete feature flag","type":"delete","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

deleteDelete feature flag


Path Params

projKey:
string
The project key
key:
required
string
The key of the feature flag to delete
Delete a feature flag in **all** environments. Be careful-- only delete feature flags that are no longer being used by your application.

User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}


Delete a feature flag in **all** environments. Be careful-- only delete feature flags that are no longer being used by your application.
{"__v":1,"_id":"571fb615d9baf12900c62a26","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57c124786df4490e00834137","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57c124786df4490e00834136","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"_links\": {\n    \"self\": {\n      \"href\": \"/api/v2/flag-statuses/default/production\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"items\": [\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/flags/default/alternate.page\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/flag-statuses/default/production/alternate.page\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"name\": \"inactive\",\n      \"lastRequested\": \"2016-08-16T21:10:11.886Z\",\n      \"default\": false\n    },\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/flags/default/new.dashboard.enable\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/flag-statuses/default/production/new.dashboard.enable\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"name\": \"inactive\",\n      \"lastRequested\": null\n    },\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/flags/default/engine.enable\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/flag-statuses/default/production/engine.enable\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"name\": \"inactive\",\n      \"lastRequested\": null\n    },\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/flags/default/image.hover\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/flag-statuses/default/production/image.hover\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"name\": \"active\",\n      \"lastRequested\": \"2016-08-27T00:38:16.372Z\",\n      \"default\": false\n    },\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/flags/default/sort.order\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/flag-statuses/default/production/sort.order\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"name\": \"active\",\n      \"lastRequested\": \"2016-08-27T00:38:15.785Z\",\n      \"default\": false\n    },\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/flags/default/simplified-checkout-flow\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/flag-statuses/default/production/simplified-checkout-flow\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"name\": \"inactive\",\n      \"lastRequested\": null\n    },\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/flags/default/new-test-flag\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/flag-statuses/default/production/new-test-flag\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"name\": \"new\",\n      \"lastRequested\": null\n    }\n  ]\n}","name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/flag-statuses/:projKey/:envKey"},"body":"Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which will be one of the following:\n\n* `new`: the feature flag was created within the last 7 days, and has not been requested yet\n* `active`: the feature flag was requested by your servers or clients within the last 7 days\n* `inactive`: the feature flag was created more than 7 days ago, and hasn't been requested by your servers or clients within the past 7 days\n* `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days","category":"571fb615d9baf12900c62a16","createdAt":"2016-02-08T19:44:13.458Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":6,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"list-feature-flag-statuses","sync_unique":"","title":"List feature flag statuses","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getList feature flag statuses


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key
Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which will be one of the following: * `new`: the feature flag was created within the last 7 days, and has not been requested yet * `active`: the feature flag was requested by your servers or clients within the last 7 days * `inactive`: the feature flag was created more than 7 days ago, and hasn't been requested by your servers or clients within the past 7 days * `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which will be one of the following: * `new`: the feature flag was created within the last 7 days, and has not been requested yet * `active`: the feature flag was requested by your servers or clients within the last 7 days * `inactive`: the feature flag was created more than 7 days ago, and hasn't been requested by your servers or clients within the past 7 days * `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days
{"__v":1,"_id":"571fb615d9baf12900c62a27","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57c124e46df4490e00834139","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57c124e46df4490e00834138","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"56b8f23a578edc0d0023cf4f","ref":"","in":"path","required":true,"desc":"The key of the feature flag","default":"","type":"string","name":"key"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/flags/default/alternate.page\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/flag-statuses/default/production/alternate.page\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"name\": \"inactive\",\n  \"lastRequested\": \"2016-08-16T21:10:11.886Z\",\n  \"default\": false\n}","name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/flag-statuses/:projKey/:envKey/:key"},"body":"Get the status for a particular feature flag.","category":"571fb615d9baf12900c62a16","createdAt":"2016-02-08T19:53:30.773Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":7,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"get-feature-flag-status","sync_unique":"","title":"Get feature flag status","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getGet feature flag status


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key
key:
required
string
The key of the feature flag
Get the status for a particular feature flag.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Get the status for a particular feature flag.
{"__v":0,"_id":"571fb616d9baf12900c62a41","api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required","params":[],"url":""},"body":"LaunchDarkly creates a record for each user passed in to `variation` calls. This record powers the autocomplete functionality on the Feature Flag management page, as well as the Users page.\n\nLaunchDarkly also offers an API that lets you tap into this data. You can use the users API to see what user data is available to LaunchDarkly, as well as determine which flag values a user will receive. You can also explicitly set which flag value a user will receive via this API.\n\nUsers are always scoped within a project and environment. In other words, each environment has its own set of user records.","category":"571fb615d9baf12900c62a1e","createdAt":"2015-05-27T20:31:24.004Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"users-overview","sync_unique":"","title":"Users overview","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Users overview


LaunchDarkly creates a record for each user passed in to `variation` calls. This record powers the autocomplete functionality on the Feature Flag management page, as well as the Users page. LaunchDarkly also offers an API that lets you tap into this data. You can use the users API to see what user data is available to LaunchDarkly, as well as determine which flag values a user will receive. You can also explicitly set which flag value a user will receive via this API. Users are always scoped within a project and environment. In other words, each environment has its own set of user records.
LaunchDarkly creates a record for each user passed in to `variation` calls. This record powers the autocomplete functionality on the Feature Flag management page, as well as the Users page. LaunchDarkly also offers an API that lets you tap into this data. You can use the users API to see what user data is available to LaunchDarkly, as well as determine which flag values a user will receive. You can also explicitly set which flag value a user will receive via this API. Users are always scoped within a project and environment. In other words, each environment has its own set of user records.
{"__v":2,"_id":"57be70b6b55b7b0e00fd35f6","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57be74ef3eb0e70e00d949b7","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57be74ef3eb0e70e00d949b6","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"57be76523eb0e70e00d949b9","ref":"","in":"query","required":false,"desc":"The ID of the last element returned in the current collection. Used for pagination.","default":"","type":"string","name":"lastId"},{"_id":"57be76523eb0e70e00d949b8","ref":"","in":"query","required":false,"desc":"The number of elements to return","default":"","type":"string","name":"limit"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"_links\": {\n    \"next\": {\n      \"href\": \"/api/v2/users/default/production?lastId=00797bb3-179c-47cb-b55a-67fe92b2e4b0&limit=20\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/users/default/production?limit=20\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"totalCount\": 10782,\n  \"items\": [\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/users/default/production\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/users/default/production/00045aff-915e-46ab-bd56-d0042688fa02\",\n          \"type\": \"application/json\"\n        },\n        \"site\": {\n          \"href\": \"/default/production/users/00045aff-915e-46ab-bd56-d0042688fa02\",\n          \"type\": \"text/html\"\n        }\n      },\n      \"lastPing\": \"2015-07-01T23:46:43.361Z\",\n      \"environmentId\": \"548f6741c1efad40031b18ae\",\n      \"user\": {\n        \"key\": \"00045aff-915e-46ab-bd56-d0042688fa02\"\n      }\n    },\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/users/default/production\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/users/default/production/00797bb3-179c-47cb-b55a-67fe92b2e4b0\",\n          \"type\": \"application/json\"\n        },\n        \"site\": {\n          \"href\": \"/default/production/users/00797bb3-179c-47cb-b55a-67fe92b2e4b0\",\n          \"type\": \"text/html\"\n        }\n      },\n      \"lastPing\": \"2015-07-01T23:55:28.682Z\",\n      \"environmentId\": \"548f6741c1efad40031b18ae\",\n      \"user\": {\n        \"key\": \"00797bb3-179c-47cb-b55a-67fe92b2e4b0\"\n      }\n    }\n  ]\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/users/:projKey/:envKey"},"body":"List all users in the environment. Includes the total count of users.","category":"571fb615d9baf12900c62a1e","createdAt":"2016-08-25T04:14:46.589Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"list-users","sync_unique":"","title":"List users","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getList users


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key

Query Params

lastId:
string
The ID of the last element returned in the current collection. Used for pagination.
limit:
string
The number of elements to return
List all users in the environment. Includes the total count of users.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



List all users in the environment. Includes the total count of users.
{"__v":1,"_id":"571fb616d9baf12900c62a43","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57be77ebebb8eb0e009f1123","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57be77ebebb8eb0e009f1122","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"55663cd5f579050d00c3d46d","ref":"","in":"path","required":true,"desc":"The user key","default":"","type":"string","name":"key"}],"results":{"codes":[{"name":"","code":"{\n   \"lastPing\":\"2015-03-03T02:37:22.492Z\",\n   \"environmentId\":\"54ac2d97de674204ddd61096\",\n   \"user\":{\n      \"key\":\"Adelina.Joor@example.com\",\n      \"ip\":\"44.145.5.17\",\n      \"country\":\"US\",\n      \"email\":\"Adelina.Joor@example.com\",\n      \"firstName\":\"Adelina\",\n      \"lastName\":\"Joor\",\n      \"avatar\":\"https://s3.amazonaws.com/uifaces/faces/twitter/shylockjoy/73.jpg\",\n      \"custom\":{\n         \"groups\":\"Microsoft\"\n      }\n   }\n}","language":"json","status":200}]},"settings":"57be249fddc0880e006f3b4a","url":"/users/:projKey/:envKey/:key"},"body":"Get a user by key. The `user` object will contain all attributes sent in `variation` calls for that key.","category":"571fb615d9baf12900c62a1e","createdAt":"2015-05-27T20:32:36.608Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"get-user","sync_unique":"","title":"Get user","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getGet user


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key
key:
required
string
The user key
Get a user by key. The `user` object will contain all attributes sent in `variation` calls for that key.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Get a user by key. The `user` object will contain all attributes sent in `variation` calls for that key.
{"__v":1,"_id":"571fb616d9baf12900c62a42","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"556630e0f579050d00c3d434","ref":"","in":"query","required":false,"desc":"Full-text search for users based on first name, last name, e-mail address, or key","default":"","type":"string","name":"q"},{"_id":"556630e0f579050d00c3d433","ref":"","in":"query","required":true,"desc":"Specifies the maximum number of items in the collection to return","default":"","type":"int","name":"limit"},{"_id":"556630e0f579050d00c3d432","ref":"","in":"query","required":false,"desc":"Specifies the first item to return in the collection","default":"","type":"int","name":"offset"},{"_id":"556630e0f579050d00c3d431","ref":"","in":"query","required":false,"desc":"A unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly","default":"","type":"int","name":"after"},{"_id":"57c0a057627a2a0e00c31867","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57c0a057627a2a0e00c31866","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n   \"totalCount\":2,\n   \"items\":[\n      {\n         \"lastPing\":\"2015-03-03T02:37:22.492Z\",\n         \"environmentId\":\"54ac2d97de674204ddd61096\",\n         \"user\":{\n            \"key\":\"Adelina.Joor@example.com\",\n            \"ip\":\"44.145.5.17\",\n            \"country\":\"US\",\n            \"email\":\"Adelina.Joor@example.com\",\n            \"firstName\":\"Adelina\",\n            \"lastName\":\"Joor\",\n            \"avatar\":\"https://s3.amazonaws.com/uifaces/faces/twitter/shylockjoy/73.jpg\",\n            \"custom\":{\n               \"groups\":\"Microsoft\"\n            }\n         }\n      },\n      {\n         \"lastPing\":\"2015-03-03T02:36:32.465Z\",\n         \"environmentId\":\"54ac2d97de674204ddd61096\",\n         \"user\":{\n            \"key\":\"Adrienne.Wierson@example.com\",\n            \"ip\":\"13.127.48.61\",\n            \"country\":\"US\",\n            \"email\":\"Adrienne.Wierson@example.com\",\n            \"firstName\":\"Adrienne\",\n            \"lastName\":\"Wierson\",\n            \"avatar\":\"https://s3.amazonaws.com/uifaces/faces/twitter/mr_shiznit/73.jpg\",\n            \"custom\":{\n               \"groups\":\"Google\"\n            }\n         }\n      }\n   ]\n}","name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/user-search/:projKey/:envKey"},"body":"Search users in LaunchDarkly based on their last active date, or a search query. This API resource returns a maximum of 10,000 results. It should not be used to enumerate all users in LaunchDarkly-- use the [List users](doc:list-users) API resource.","category":"571fb615d9baf12900c62a1e","createdAt":"2015-05-27T20:32:06.563Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"find-users","sync_unique":"","title":"Find users","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getFind users


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key

Query Params

q:
string
Full-text search for users based on first name, last name, e-mail address, or key
limit:
required
integer
Specifies the maximum number of items in the collection to return
offset:
integer
Specifies the first item to return in the collection
after:
integer
A unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly
Search users in LaunchDarkly based on their last active date, or a search query. This API resource returns a maximum of 10,000 results. It should not be used to enumerate all users in LaunchDarkly-- use the [List users](doc:list-users) API resource.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Search users in LaunchDarkly based on their last active date, or a search query. This API resource returns a maximum of 10,000 results. It should not be used to enumerate all users in LaunchDarkly-- use the [List users](doc:list-users) API resource.
{"project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"571fb615d9baf12900c62a1e","_id":"58223df2c3b01d31008a1112","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-11-08T21:04:50.722Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[{"status":204,"language":"json","code":"","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"57be249fddc0880e006f3b4a","auth":"required","params":[{"_id":"58223df2c3b01d31008a1115","ref":"","in":"path","required":false,"desc":"The project Key","default":"","type":"string","name":"projKey"},{"_id":"58223df2c3b01d31008a1114","ref":"","in":"path","required":false,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"58223df2c3b01d31008a1113","ref":"","in":"path","required":false,"desc":"The user key","default":"","type":"string","name":"key"}],"url":"/users/:projKey/:envKey/:key"},"isReference":true,"order":999,"body":"Delete a user by key.","excerpt":"","slug":"delete-user","type":"delete","title":"Delete user","__v":0,"childrenPages":[]}

deleteDelete user


Path Params

projKey:
string
The project Key
envKey:
string
The environment key
key:
string
The user key
Delete a user by key.

User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}


Delete a user by key.
{"__v":0,"_id":"57c0a089115d800e00d4cc6e","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"body":"LaunchDarkly's User Settings API provides a picture of all feature flags and their current values for a specific user. This gives you instant visibility of how a particular user is experiencing your site or application. \n\nThe User Settings API can also be used to assign a user to a specific variation for any feature flag.","category":"57be0df1b9ef7c220047578f","createdAt":"2016-08-26T20:03:21.174Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"user-settings-overview","sync_unique":"","title":"User settings overview","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

User settings overview


LaunchDarkly's User Settings API provides a picture of all feature flags and their current values for a specific user. This gives you instant visibility of how a particular user is experiencing your site or application. The User Settings API can also be used to assign a user to a specific variation for any feature flag.
LaunchDarkly's User Settings API provides a picture of all feature flags and their current values for a specific user. This gives you instant visibility of how a particular user is experiencing your site or application. The User Settings API can also be used to assign a user to a specific variation for any feature flag.
{"__v":1,"_id":"571fb615d9baf12900c62a37","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"55edf4d451ee721700b31442","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57c0a38fa3ba0b0e00eb11b2","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"57c0a38fa3ba0b0e00eb11b1","ref":"","in":"path","required":true,"desc":"The user key","default":"","type":"string","name":"key"}],"results":{"codes":[{"name":"","code":"{\n  \"items\": {\n    \"sort.order\": {\n      \"_links\": {\n        \"self\": {\n          \"href\": \"/api/v2/users/lacuna/production/Abbie_Braun/flags/sort.order\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"_value\": true,\n      \"setting\": null\n    },\n    \"alternate.page\": {\n      \"_links\": {\n        \"self\": {\n          \"href\": \"/api/v2/users/lacuna/production/Abbie_Braun/flags/alternate.page\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"_value\": false,\n      \"setting\": null\n    }    \n  },\n  \"_links\": {\n    \"self\": {\n      \"href\": \"/api/v2/users/lacuna/production/Abbie_Braun/flags\",\n      \"type\": \"application/json\"\n    }\n  }\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"57be249fddc0880e006f3b4a","url":"/users/:projKey/:envKey/:key/flags"},"body":"Lists the current flag settings for a given user. The most important attribute in the response is the  `_value`. The `_value` is the current setting that the user will see. For a boolean feature toggle, this will be `true`, `false`, or `null` if there is no defined fallthrough value. The example response indicates that the user `Abbie_Braun` will have the `sort.order` flag enabled, and the `alternate.page` flag disabled.\n\nThe `setting` attribute indicates whether you've explicitly targeted this user to receive a particular variation. For example, if you have explicitly turned off a feature toggle for a user, setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation.","category":"57be0df1b9ef7c220047578f","createdAt":"2015-09-07T20:34:28.986Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"flag-settings-for-user","sync_unique":"","title":"List flag settings for user","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getList flag settings for user


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key
key:
required
string
The user key
Lists the current flag settings for a given user. The most important attribute in the response is the `_value`. The `_value` is the current setting that the user will see. For a boolean feature toggle, this will be `true`, `false`, or `null` if there is no defined fallthrough value. The example response indicates that the user `Abbie_Braun` will have the `sort.order` flag enabled, and the `alternate.page` flag disabled. The `setting` attribute indicates whether you've explicitly targeted this user to receive a particular variation. For example, if you have explicitly turned off a feature toggle for a user, setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Lists the current flag settings for a given user. The most important attribute in the response is the `_value`. The `_value` is the current setting that the user will see. For a boolean feature toggle, this will be `true`, `false`, or `null` if there is no defined fallthrough value. The example response indicates that the user `Abbie_Braun` will have the `sort.order` flag enabled, and the `alternate.page` flag disabled. The `setting` attribute indicates whether you've explicitly targeted this user to receive a particular variation. For example, if you have explicitly turned off a feature toggle for a user, setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation.
{"__v":1,"_id":"571fb615d9baf12900c62a38","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57c0a7e7c3c39d0e003769f3","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57c0a7e7c3c39d0e003769f2","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"55edf5777145f717001ac144","ref":"","in":"path","required":true,"desc":"The user key","default":"","type":"string","name":"key"},{"_id":"55edf5777145f717001ac143","ref":"","in":"path","required":true,"desc":"The feature key","default":"","type":"string","name":"featureKey"}],"results":{"codes":[{"name":"","code":"{\n  \"_links\": {\n    \"self\": {\n      \"href\": \"/api/v2/users/lacuna/production/Abbie_Braun/flags/sort.order\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"_value\": true,\n  \"setting\": null\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"57be249fddc0880e006f3b4a","url":"/users/:projKey/:envKey/:key/features/:featureKey"},"body":"Fetch a single flag setting for a user by key. The most important attribute in the response is the  `_value`. The `_value` is the current setting that the user will see. For a boolean feature toggle, this will be `true`, `false`, or `null` if there is no defined fallthrough value. The example response indicates that the user `Abbie_Braun` will have the `sort.order` flag enabled.\n\nThe `setting` attribute indicates whether you've explicitly targeted this user to receive a particular variation. For example, if you have explicitly turned off a feature toggle for a user, setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation.","category":"57be0df1b9ef7c220047578f","createdAt":"2015-09-07T20:37:11.520Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"get-flag-settings-for-user","sync_unique":"","title":"Get flag setting for user","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getGet flag setting for user


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key
key:
required
string
The user key
featureKey:
required
string
The feature key
Fetch a single flag setting for a user by key. The most important attribute in the response is the `_value`. The `_value` is the current setting that the user will see. For a boolean feature toggle, this will be `true`, `false`, or `null` if there is no defined fallthrough value. The example response indicates that the user `Abbie_Braun` will have the `sort.order` flag enabled. The `setting` attribute indicates whether you've explicitly targeted this user to receive a particular variation. For example, if you have explicitly turned off a feature toggle for a user, setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Fetch a single flag setting for a user by key. The most important attribute in the response is the `_value`. The `_value` is the current setting that the user will see. For a boolean feature toggle, this will be `true`, `false`, or `null` if there is no defined fallthrough value. The example response indicates that the user `Abbie_Braun` will have the `sort.order` flag enabled. The `setting` attribute indicates whether you've explicitly targeted this user to receive a particular variation. For example, if you have explicitly turned off a feature toggle for a user, setting will be `false`. A setting of `null` means that you haven't assigned that user to a specific variation.
{"__v":4,"_id":"571fb615d9baf12900c62a39","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"57c0a82b6df4490e00834108","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"57c0a82b6df4490e00834107","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"55edf658993c171700a2c093","ref":"","in":"path","required":false,"desc":"The user key","default":"","type":"string","name":"key"},{"_id":"55edf658993c171700a2c092","ref":"","in":"path","required":false,"desc":"The feature key","default":"","type":"string","name":"featureKey"},{"_id":"57c4ccee76062f0e001b369e","default":"","desc":"The variation value to set for the user","in":"body","name":"setting","ref":"","required":false,"type":"boolean"}],"results":{"codes":[{"name":"","code":"{}","language":"json","status":204},{"name":"","code":"{}","language":"json","status":400}]},"settings":"57be2876ddc0880e006f3b4d","url":"/users/:projKey/:envKey/:key/flags/:featureKey"},"body":"Specifically enable or disable a feature flag for a user based on their key. \n\nTo change the setting, send a `PUT` request to this URL with a request body containing the flag value. For example, to disable the sort.order flag for the user `test@test.com`, send a `PUT` to `https://app.launchdarkly.com/api/users/test@test.com/features/sort.order` with the following body:\n\n```\n{\n  \"setting\": false\n}\n```\nA couple of notes: \n\n* If LaunchDarkly has never seen the user's key before, we'll calculate the flag values as if you called toggle with a user containing just that key— no other attributes. Otherwise, the flag values are calculated with the user object we received from the last toggle call with that user key.\n* You can “clear” the current setting for a user by sending a `PUT` to the flag with a setting of `null`.\n* This resource works for multivariate flags as well, but the API explorer on this page will only work with boolean flags.","category":"57be0df1b9ef7c220047578f","createdAt":"2015-09-07T20:40:56.958Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":3,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"update-flag-setting-for-user","sync_unique":"","title":"Update flag setting for user","type":"put","updates":["56e9fb015ea49c0e0055e93d","57d026166b4de029009583c1"],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

putUpdate flag setting for user


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key
key:
string
The user key
featureKey:
string
The feature key

Body Params

setting:
boolean
The variation value to set for the user
Specifically enable or disable a feature flag for a user based on their key. To change the setting, send a `PUT` request to this URL with a request body containing the flag value. For example, to disable the sort.order flag for the user `test@test.com`, send a `PUT` to `https://app.launchdarkly.com/api/users/test@test.com/features/sort.order` with the following body: ``` { "setting": false } ``` A couple of notes: * If LaunchDarkly has never seen the user's key before, we'll calculate the flag values as if you called toggle with a user containing just that key— no other attributes. Otherwise, the flag values are calculated with the user object we received from the last toggle call with that user key. * You can “clear” the current setting for a user by sending a `PUT` to the flag with a setting of `null`. * This resource works for multivariate flags as well, but the API explorer on this page will only work with boolean flags.

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Specifically enable or disable a feature flag for a user based on their key. To change the setting, send a `PUT` request to this URL with a request body containing the flag value. For example, to disable the sort.order flag for the user `test@test.com`, send a `PUT` to `https://app.launchdarkly.com/api/users/test@test.com/features/sort.order` with the following body: ``` { "setting": false } ``` A couple of notes: * If LaunchDarkly has never seen the user's key before, we'll calculate the flag values as if you called toggle with a user containing just that key— no other attributes. Otherwise, the flag values are calculated with the user object we received from the last toggle call with that user key. * You can “clear” the current setting for a user by sending a `PUT` to the flag with a setting of `null`. * This resource works for multivariate flags as well, but the API explorer on this page will only work with boolean flags.
{"__v":0,"_id":"571fb615d9baf12900c62a31","api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required","params":[],"url":""},"body":"The audit log contains a record of all the changes made to any resource in the system. You can filter the audit log by timestamps, or use a custom policy to select which entries to receive.","category":"571fb615d9baf12900c62a18","createdAt":"2016-02-08T22:00:46.350Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"audit-log-overview","sync_unique":"","title":"Audit log overview","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Audit log overview


The audit log contains a record of all the changes made to any resource in the system. You can filter the audit log by timestamps, or use a custom policy to select which entries to receive.
The audit log contains a record of all the changes made to any resource in the system. You can filter the audit log by timestamps, or use a custom policy to select which entries to receive.
{"__v":1,"_id":"571fb615d9baf12900c62a32","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"56b90f08578edc0d0023cf7c","ref":"","in":"query","required":false,"desc":"A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have before this timestamp.","default":"","type":"int","name":"before"},{"_id":"56b90f08578edc0d0023cf7b","ref":"","in":"query","required":false,"desc":"A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have occurred after this timestamp.","default":"","type":"int","name":"after"},{"_id":"56b90f08578edc0d0023cf7a","ref":"","in":"query","required":false,"desc":"A text search query","default":"","type":"string","name":"q"},{"_id":"56b90f08578edc0d0023cf79","ref":"","in":"query","required":false,"desc":"A limit on the number of audit log entries to be returned, between 1 and 20","default":"","type":"int","name":"limit"},{"_id":"57c0a9cbc3c39d0e003769f7","ref":"","in":"query","required":false,"desc":"A resource specifier, allowing you to filter audit log listings by resource","default":"","type":"string","name":"spec"}],"results":{"codes":[{"name":"","code":"{\n  \"items\": [\n    {\n      \"_links\": {\n        \"canonical\": {\n          \"href\": \"/api/v2/projects/alexis/environments/test\",\n          \"type\": \"application/json\"\n        },\n        \"parent\": {\n          \"href\": \"/api/v2/auditlog\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/auditlog/57c0a8e29969090743529965\",\n          \"type\": \"application/json\"\n        },\n        \"site\": {\n          \"href\": \"/settings#/projects\",\n          \"type\": \"text/html\"\n        }\n      },\n      \"_id\": \"57c0a8e29969090743529965\",\n      \"date\": 1472243938774,\n      \"accesses\": [\n        {\n          \"action\": \"updateName\",\n          \"resource\": \"proj/alexis:env/test\"\n        }\n      ],\n      \"kind\": \"environment\",\n      \"name\": \"Testing\",\n      \"description\": \"- Changed the name from ~~Test~~ to *Testing*\",\n      \"member\": {\n        \"_links\": {\n          \"parent\": {\n            \"href\": \"/internal/account/members\",\n            \"type\": \"application/json\"\n          },\n          \"self\": {\n            \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n            \"type\": \"application/json\"\n          }\n        },\n        \"_id\": \"548f6741c1efad40031b18ae\",\n        \"email\": \"refapp@launchdarkly.com\",\n        \"firstName\": \"Reese\",\n        \"lastName\": \"Applebaum\"\n      },\n      \"titleVerb\": \"changed the name of\",\n      \"title\": \"[Reese Applebaum](mailto:refapp@launchdarkly.com) changed the name of [Testing](https://app.launchdarkly.com/settings#/projects)\",\n      \"target\": {\n        \"_links\": {\n          \"canonical\": {\n            \"href\": \"/api/v2/projects/alexis/environments/test\",\n            \"type\": \"application/json\"\n          },\n          \"site\": {\n            \"href\": \"/settings#/projects\",\n            \"type\": \"text/html\"\n          }\n        },\n        \"name\": \"Testing\",\n        \"resources\": [\n          \"proj/alexis:env/test\"\n        ]\n      }\n    },\n    {\n      \"_links\": {\n        \"canonical\": {\n          \"href\": \"/api/v2/webhooks/57c086269969090743529963\",\n          \"type\": \"application/json\"\n        },\n        \"parent\": {\n          \"href\": \"/api/v2/auditlog\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/auditlog/57c08643719d2b07436d49a3\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"_id\": \"57c08643719d2b07436d49a3\",\n      \"date\": 1472235075164,\n      \"accesses\": [\n        {\n          \"action\": \"deleteWebhook\",\n          \"resource\": \"webhook/57c086269969090743529963\"\n        }\n      ],\n      \"kind\": \"webhook\",\n      \"name\": \"http://google.com\",\n      \"description\": \"\",\n      \"member\": {\n        \"_links\": {\n          \"parent\": {\n            \"href\": \"/internal/account/members\",\n            \"type\": \"application/json\"\n          },\n          \"self\": {\n            \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n            \"type\": \"application/json\"\n          }\n        },\n        \"_id\": \"548f6741c1efad40031b18ae\",\n        \"email\": \"refapp@launchdarkly.com\",\n        \"firstName\": \"Reese\",\n        \"lastName\": \"Applebaum\"\n      },\n      \"titleVerb\": \"deleted\",\n      \"title\": \"[Reese Applebaum](mailto:refapp@launchdarkly.com) deleted http://google.com\",\n      \"target\": {\n        \"_links\": {\n          \"canonical\": {\n            \"href\": \"/api/v2/webhooks/57c086269969090743529963\",\n            \"type\": \"application/json\"\n          }\n        },\n        \"name\": \"http://google.com\",\n        \"resources\": [\n          \"webhook/57c086269969090743529963\"\n        ]\n      }\n    }\n  ],\n  \"_links\": {\n    \"next\": {\n      \"href\": \"/api/v2/auditlog?before=1472235075164&limit=10\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/auditlog\",\n      \"type\": \"application/json\"\n    }\n  }\n}","language":"json","status":200},{"name":"","code":"{\nmessage: \"'before' must be a valid epoch time in milliseconds\"\n}","language":"json","status":400}]},"settings":"57be249fddc0880e006f3b4a","url":"/auditlog"},"body":"Get a list of all audit log entries. The query parameters allow you to restrict the returned results by date ranges, resource specifiers, or a full-text search query.","category":"571fb615d9baf12900c62a18","createdAt":"2016-02-08T21:57:18.947Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"list-audit-log-entries","sync_unique":"","title":"List audit log feature flag entries","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getList audit log feature flag entries


Query Params

before:
integer
A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have before this timestamp.
after:
integer
A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have occurred after this timestamp.
q:
string
A text search query
limit:
integer
A limit on the number of audit log entries to be returned, between 1 and 20
spec:
string
A resource specifier, allowing you to filter audit log listings by resource
Get a list of all audit log entries. The query parameters allow you to restrict the returned results by date ranges, resource specifiers, or a full-text search query.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Get a list of all audit log entries. The query parameters allow you to restrict the returned results by date ranges, resource specifiers, or a full-text search query.
{"__v":0,"_id":"571fb615d9baf12900c62a33","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"56b91fd9ddeb231700e698f4","ref":"","required":false,"desc":"The ID of the audit log entry","default":"","type":"string","name":"id","in":"path"}],"results":{"codes":[{"name":"","code":"{\n  \"_links\": {\n    \"canonical\": {\n      \"href\": \"/api/v2/webhooks/57c086269969090743529963\",\n      \"type\": \"application/json\"\n    },\n    \"parent\": {\n      \"href\": \"/api/v2/auditlog\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/auditlog/57c08643719d2b07436d49a3\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"_id\": \"57c08643719d2b07436d49a3\",\n  \"date\": 1472235075164,\n  \"accesses\": [\n    {\n      \"action\": \"deleteWebhook\",\n      \"resource\": \"webhook/57c086269969090743529963\"\n    }\n  ],\n  \"kind\": \"webhook\",\n  \"name\": \"http://google.com\",\n  \"description\": \"\",\n  \"member\": {\n    \"_links\": {\n      \"parent\": {\n        \"href\": \"/internal/account/members\",\n        \"type\": \"application/json\"\n      },\n      \"self\": {\n        \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n        \"type\": \"application/json\"\n      }\n    },\n    \"_id\": \"548f6741c1efad40031b18ae\",\n    \"email\": \"refapp@launchdarkly.com\",\n    \"firstName\": \"Reese\",\n    \"lastName\": \"Applebaum\"\n  },\n  \"titleVerb\": \"deleted\",\n  \"title\": \"[Reese Applebaum](mailto:refapp@launchdarkly.com) deleted http://google.com\",\n  \"target\": {\n    \"_links\": {\n      \"canonical\": {\n        \"href\": \"/api/v2/webhooks/57c086269969090743529963\",\n        \"type\": \"application/json\"\n      }\n    },\n    \"name\": \"http://google.com\",\n    \"resources\": [\n      \"webhook/57c086269969090743529963\"\n    ]\n  }\n}","language":"json","status":200}]},"settings":"57be249fddc0880e006f3b4a","url":"/auditlog/:id"},"body":"Fetch a detailed audit log entry representation. The detailed representation includes several fields that are not present in the summary representation:\n\n* `delta`: the JSON patch body that was used in the request to update the entity\n* `previousVersion`: a JSON representation of the previous version of the entity\n* `currentVersion`: a JSON representation of the current version of the entity","category":"571fb615d9baf12900c62a18","createdAt":"2016-02-08T23:08:09.012Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"get-audit-log-entry","sync_unique":"","title":"Get audit log entry","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getGet audit log entry


Path Params

id:
string
The ID of the audit log entry
Fetch a detailed audit log entry representation. The detailed representation includes several fields that are not present in the summary representation: * `delta`: the JSON patch body that was used in the request to update the entity * `previousVersion`: a JSON representation of the previous version of the entity * `currentVersion`: a JSON representation of the current version of the entity

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Fetch a detailed audit log entry representation. The detailed representation includes several fields that are not present in the summary representation: * `delta`: the JSON patch body that was used in the request to update the entity * `previousVersion`: a JSON representation of the previous version of the entity * `currentVersion`: a JSON representation of the current version of the entity
{"__v":0,"_id":"571fb616d9baf12900c62a49","api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required","params":[],"url":""},"body":"The webhooks API allows you to build your own integrations that subscribe to activities in LaunchDarkly. When an activity is generated in LaunchDarkly (for example, changing a feature flag, creating a new project, etc.), we'll send an HTTP POST payload to the webhook's configured URL. Use webhooks to update external issue trackers, update support tickets, notify customers of new feature rollouts, and more. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Payload\"\n}\n[/block]\nThe webhook payload is identical to an [Audit log entry](doc:get-audit-log-entry) . Here's a sample payload:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"_links\\\": {\\n    \\\"canonical\\\": {\\n      \\\"href\\\": \\\"/api/v2/projects/alexis/environments/test\\\",\\n      \\\"type\\\": \\\"application/json\\\"\\n    },\\n    \\\"parent\\\": {\\n      \\\"href\\\": \\\"/api/v2/auditlog\\\",\\n      \\\"type\\\": \\\"application/json\\\"\\n    },\\n    \\\"self\\\": {\\n      \\\"href\\\": \\\"/api/v2/auditlog/57c0a8e29969090743529965\\\",\\n      \\\"type\\\": \\\"application/json\\\"\\n    },\\n    \\\"site\\\": {\\n      \\\"href\\\": \\\"/settings#/projects\\\",\\n      \\\"type\\\": \\\"text/html\\\"\\n    }\\n  },\\n  \\\"_id\\\": \\\"57c0a8e29969090743529965\\\",\\n  \\\"date\\\": 1472243938774,\\n  \\\"accesses\\\": [\\n    {\\n      \\\"action\\\": \\\"updateName\\\",\\n      \\\"resource\\\": \\\"proj/alexis:env/test\\\"\\n    }\\n  ],\\n  \\\"kind\\\": \\\"environment\\\",\\n  \\\"name\\\": \\\"Testing\\\",\\n  \\\"description\\\": \\\"- Changed the name from ~~Test~~ to *Testing*\\\",\\n  \\\"member\\\": {\\n    \\\"_links\\\": {\\n      \\\"parent\\\": {\\n        \\\"href\\\": \\\"/internal/account/members\\\",\\n        \\\"type\\\": \\\"application/json\\\"\\n      },\\n      \\\"self\\\": {\\n        \\\"href\\\": \\\"/internal/account/members/548f6741c1efad40031b18ae\\\",\\n        \\\"type\\\": \\\"application/json\\\"\\n      }\\n    },\\n    \\\"_id\\\": \\\"548f6741c1efad40031b18ae\\\",\\n    \\\"email\\\": \\\"refapp@launchdarkly.com\\\",\\n    \\\"firstName\\\": \\\"Reese\\\",\\n    \\\"lastName\\\": \\\"Applebaum\\\"\\n  },\\n  \\\"titleVerb\\\": \\\"changed the name of\\\",\\n  \\\"title\\\": \\\"[Reese Applebaum](mailto:refapp@launchdarkly.com) changed the name of [Testing](https://app.launchdarkly.com/settings#/projects)\\\",\\n  \\\"target\\\": {\\n    \\\"_links\\\": {\\n      \\\"canonical\\\": {\\n        \\\"href\\\": \\\"/api/v2/projects/alexis/environments/test\\\",\\n        \\\"type\\\": \\\"application/json\\\"\\n      },\\n      \\\"site\\\": {\\n        \\\"href\\\": \\\"/settings#/projects\\\",\\n        \\\"type\\\": \\\"text/html\\\"\\n      }\\n    },\\n    \\\"name\\\": \\\"Testing\\\",\\n    \\\"resources\\\": [\\n      \\\"proj/alexis:env/test\\\"\\n    ]\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Sample payload\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Signing\"\n}\n[/block]\nWhen creating a webhook, you can define an optional `secret`. If defined, the webhook `POST` request will include an `X-LD-Signature` header, whose value will contain an HMAC SHA256 hex digest of the webhook payload, using the `secret` as the key.\n\nYou should compute the signature of the payload using the same shared secret in your code to verify that the webhook was triggered by LaunchDarkly.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Retries\"\n}\n[/block]\nIf LaunchDarkly receives a non-`2xx` response to a webhook `POST`, it will attempt to retry the delivery once. Webhook delivery is not guaranteed, and integrations built on webhooks should be tolerant of delivery failures.","category":"571fb615d9baf12900c62a19","createdAt":"2016-03-04T21:30:23.618Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"webhooks-overview","sync_unique":"","title":"Webhooks overview","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

Webhooks overview


The webhooks API allows you to build your own integrations that subscribe to activities in LaunchDarkly. When an activity is generated in LaunchDarkly (for example, changing a feature flag, creating a new project, etc.), we'll send an HTTP POST payload to the webhook's configured URL. Use webhooks to update external issue trackers, update support tickets, notify customers of new feature rollouts, and more. [block:api-header] { "type": "basic", "title": "Payload" } [/block] The webhook payload is identical to an [Audit log entry](doc:get-audit-log-entry) . Here's a sample payload: [block:code] { "codes": [ { "code": "{\n \"_links\": {\n \"canonical\": {\n \"href\": \"/api/v2/projects/alexis/environments/test\",\n \"type\": \"application/json\"\n },\n \"parent\": {\n \"href\": \"/api/v2/auditlog\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/v2/auditlog/57c0a8e29969090743529965\",\n \"type\": \"application/json\"\n },\n \"site\": {\n \"href\": \"/settings#/projects\",\n \"type\": \"text/html\"\n }\n },\n \"_id\": \"57c0a8e29969090743529965\",\n \"date\": 1472243938774,\n \"accesses\": [\n {\n \"action\": \"updateName\",\n \"resource\": \"proj/alexis:env/test\"\n }\n ],\n \"kind\": \"environment\",\n \"name\": \"Testing\",\n \"description\": \"- Changed the name from ~~Test~~ to *Testing*\",\n \"member\": {\n \"_links\": {\n \"parent\": {\n \"href\": \"/internal/account/members\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n \"type\": \"application/json\"\n }\n },\n \"_id\": \"548f6741c1efad40031b18ae\",\n \"email\": \"refapp@launchdarkly.com\",\n \"firstName\": \"Reese\",\n \"lastName\": \"Applebaum\"\n },\n \"titleVerb\": \"changed the name of\",\n \"title\": \"[Reese Applebaum](mailto:refapp@launchdarkly.com) changed the name of [Testing](https://app.launchdarkly.com/settings#/projects)\",\n \"target\": {\n \"_links\": {\n \"canonical\": {\n \"href\": \"/api/v2/projects/alexis/environments/test\",\n \"type\": \"application/json\"\n },\n \"site\": {\n \"href\": \"/settings#/projects\",\n \"type\": \"text/html\"\n }\n },\n \"name\": \"Testing\",\n \"resources\": [\n \"proj/alexis:env/test\"\n ]\n }\n}", "language": "json", "name": "Sample payload" } ] } [/block] [block:api-header] { "type": "basic", "title": "Signing" } [/block] When creating a webhook, you can define an optional `secret`. If defined, the webhook `POST` request will include an `X-LD-Signature` header, whose value will contain an HMAC SHA256 hex digest of the webhook payload, using the `secret` as the key. You should compute the signature of the payload using the same shared secret in your code to verify that the webhook was triggered by LaunchDarkly. [block:api-header] { "type": "basic", "title": "Retries" } [/block] If LaunchDarkly receives a non-`2xx` response to a webhook `POST`, it will attempt to retry the delivery once. Webhook delivery is not guaranteed, and integrations built on webhooks should be tolerant of delivery failures.
The webhooks API allows you to build your own integrations that subscribe to activities in LaunchDarkly. When an activity is generated in LaunchDarkly (for example, changing a feature flag, creating a new project, etc.), we'll send an HTTP POST payload to the webhook's configured URL. Use webhooks to update external issue trackers, update support tickets, notify customers of new feature rollouts, and more. [block:api-header] { "type": "basic", "title": "Payload" } [/block] The webhook payload is identical to an [Audit log entry](doc:get-audit-log-entry) . Here's a sample payload: [block:code] { "codes": [ { "code": "{\n \"_links\": {\n \"canonical\": {\n \"href\": \"/api/v2/projects/alexis/environments/test\",\n \"type\": \"application/json\"\n },\n \"parent\": {\n \"href\": \"/api/v2/auditlog\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/v2/auditlog/57c0a8e29969090743529965\",\n \"type\": \"application/json\"\n },\n \"site\": {\n \"href\": \"/settings#/projects\",\n \"type\": \"text/html\"\n }\n },\n \"_id\": \"57c0a8e29969090743529965\",\n \"date\": 1472243938774,\n \"accesses\": [\n {\n \"action\": \"updateName\",\n \"resource\": \"proj/alexis:env/test\"\n }\n ],\n \"kind\": \"environment\",\n \"name\": \"Testing\",\n \"description\": \"- Changed the name from ~~Test~~ to *Testing*\",\n \"member\": {\n \"_links\": {\n \"parent\": {\n \"href\": \"/internal/account/members\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n \"type\": \"application/json\"\n }\n },\n \"_id\": \"548f6741c1efad40031b18ae\",\n \"email\": \"refapp@launchdarkly.com\",\n \"firstName\": \"Reese\",\n \"lastName\": \"Applebaum\"\n },\n \"titleVerb\": \"changed the name of\",\n \"title\": \"[Reese Applebaum](mailto:refapp@launchdarkly.com) changed the name of [Testing](https://app.launchdarkly.com/settings#/projects)\",\n \"target\": {\n \"_links\": {\n \"canonical\": {\n \"href\": \"/api/v2/projects/alexis/environments/test\",\n \"type\": \"application/json\"\n },\n \"site\": {\n \"href\": \"/settings#/projects\",\n \"type\": \"text/html\"\n }\n },\n \"name\": \"Testing\",\n \"resources\": [\n \"proj/alexis:env/test\"\n ]\n }\n}", "language": "json", "name": "Sample payload" } ] } [/block] [block:api-header] { "type": "basic", "title": "Signing" } [/block] When creating a webhook, you can define an optional `secret`. If defined, the webhook `POST` request will include an `X-LD-Signature` header, whose value will contain an HMAC SHA256 hex digest of the webhook payload, using the `secret` as the key. You should compute the signature of the payload using the same shared secret in your code to verify that the webhook was triggered by LaunchDarkly. [block:api-header] { "type": "basic", "title": "Retries" } [/block] If LaunchDarkly receives a non-`2xx` response to a webhook `POST`, it will attempt to retry the delivery once. Webhook delivery is not guaranteed, and integrations built on webhooks should be tolerant of delivery failures.
{"__v":0,"_id":"571fb616d9baf12900c62a4a","api":{"auth":"required","examples":{"codes":[]},"params":[],"results":{"codes":[{"name":"","code":"{\n  \"_links\": {\n    \"self\": {\n      \"href\": \"/api/v2/webhooks\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"items\": [\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/webhooks\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/webhooks/57c0ae4b719d2b07436d49a8\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"_id\": \"57c0ae4b719d2b07436d49a8\",\n      \"url\": \"http://requestb.in/wl7i6twl\",\n      \"secret\": \"3c857a8da2f349edb015b311eca2d3d1\",\n      \"on\": false,\n      \"tags\": []\n    }\n  ]\n}","language":"json","status":200}]},"settings":"57be249fddc0880e006f3b4a","url":"/webhooks"},"body":"Fetch a list of all webhooks.","category":"571fb615d9baf12900c62a19","createdAt":"2016-03-04T21:31:19.332Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":1,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"list-webhooks","sync_unique":"","title":"List webhooks","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getList webhooks


Fetch a list of all webhooks.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Fetch a list of all webhooks.
{"__v":0,"_id":"571fb616d9baf12900c62a4b","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"56da03d42716531d00b1a5e2","ref":"","required":false,"desc":"The ID of the webhook","default":"","type":"string","name":"id","in":"path"}],"results":{"codes":[{"name":"","code":"{\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/webhooks\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/webhooks/57c0ae4b719d2b07436d49a8\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"_id\": \"57c0ae4b719d2b07436d49a8\",\n  \"url\": \"http://requestb.in/wl7i6twl\",\n  \"secret\": \"3c857a8da2f349edb015b311eca2d3d1\",\n  \"on\": false,\n  \"tags\": []\n}","language":"json","status":200}]},"settings":"57be249fddc0880e006f3b4a","url":"/webhooks/:id"},"body":"Get a single webhook by ID.","category":"571fb615d9baf12900c62a19","createdAt":"2016-03-04T21:30:49.235Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":2,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"get-webhook","sync_unique":"","title":"Get webhook","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getGet webhook


Path Params

id:
string
The ID of the webhook
Get a single webhook by ID.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Get a single webhook by ID.
{"__v":0,"_id":"571fb616d9baf12900c62a4c","api":{"auth":"required","examples":{"codes":[{"language":"javascript","code":"{\n  \"url\": \"http://www.example.com\",\n  \"secret\": \"frobozz\",\n  \"sign\": true,\n  \"on\": true\n}"}]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/webhooks\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/webhooks/57c0af609969090743529967\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"_id\": \"57c0af609969090743529967\",\n  \"url\": \"http://www.example.com\",\n  \"secret\": \"frobozz\",\n  \"on\": true,\n  \"tags\": []\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"57be2876ddc0880e006f3b4d","url":"/webhooks"},"body":"Creates a new webhook.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request format\"\n}\n[/block]\nThe `sign` attribute can be set to `false`. In that case, the webhook will not include a signature header, and the `secret` can be omitted. \n\nIf `sign` is `true`, and the `secret` attribute is omitted, LaunchDarkly will automatically generate a secret for you.\n\nYou can also specify an optional `statements` array representing a [Custom role policy](http://docs.launchdarkly.com/v2.0/docs/custom-roles), defining a filter on resource kinds that the webhook should respond to. For example, you can create a list of statements describing feature flags in your production environment, and the webhook will only receive a payload for changes to those feature flags.","category":"571fb615d9baf12900c62a19","createdAt":"2016-03-04T21:31:07.450Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":3,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"create-webhook","sync_unique":"","title":"Create webhook","type":"post","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

postCreate webhook


Creates a new webhook. [block:api-header] { "type": "basic", "title": "Request format" } [/block] The `sign` attribute can be set to `false`. In that case, the webhook will not include a signature header, and the `secret` can be omitted. If `sign` is `true`, and the `secret` attribute is omitted, LaunchDarkly will automatically generate a secret for you. You can also specify an optional `statements` array representing a [Custom role policy](http://docs.launchdarkly.com/v2.0/docs/custom-roles), defining a filter on resource kinds that the webhook should respond to. For example, you can create a list of statements describing feature flags in your production environment, and the webhook will only receive a payload for changes to those feature flags.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Creates a new webhook. [block:api-header] { "type": "basic", "title": "Request format" } [/block] The `sign` attribute can be set to `false`. In that case, the webhook will not include a signature header, and the `secret` can be omitted. If `sign` is `true`, and the `secret` attribute is omitted, LaunchDarkly will automatically generate a secret for you. You can also specify an optional `statements` array representing a [Custom role policy](http://docs.launchdarkly.com/v2.0/docs/custom-roles), defining a filter on resource kinds that the webhook should respond to. For example, you can create a list of statements describing feature flags in your production environment, and the webhook will only receive a payload for changes to those feature flags.
{"__v":1,"_id":"571fb616d9baf12900c62a4d","api":{"auth":"required","examples":{"codes":[{"code":"[\n  {\n    \"op\": \"replace\",\n    \"path\": \"/on\",\n    \"value\": true\n  }\n]","language":"json"}]},"params":[{"_id":"57c0b01ac3c39d0e003769fd","ref":"","in":"path","required":true,"desc":"The ID of the webhook to update","default":"","type":"string","name":"id"}],"results":{"codes":[{"name":"","code":"{\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/webhooks\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/webhooks/57c0af609969090743529967\",\n      \"type\": \"application/json\"\n    }\n  },\n  \"_id\": \"57c0af609969090743529967\",\n  \"url\": \"http://www.example.com\",\n  \"secret\": \"frobozz\",\n  \"on\": true,\n  \"tags\": []\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"57be24d969196d0e00d0b5de","url":"/webhooks/:id"},"body":"Update a webhook's settings. The request should be a valid [JSON Patch document](https://tools.ietf.org/html/rfc6902) describing the changes to be made to the webhook.","category":"571fb615d9baf12900c62a19","createdAt":"2016-03-04T21:31:38.763Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":4,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"update-webhook","sync_unique":"","title":"Update webhook","type":"patch","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

patchUpdate webhook


Path Params

id:
required
string
The ID of the webhook to update
Update a webhook's settings. The request should be a valid [JSON Patch document](https://tools.ietf.org/html/rfc6902) describing the changes to be made to the webhook.

User Information

Try It Out


patch
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Update a webhook's settings. The request should be a valid [JSON Patch document](https://tools.ietf.org/html/rfc6902) describing the changes to be made to the webhook.
{"__v":0,"_id":"571fb616d9baf12900c62a4e","api":{"auth":"required","examples":{"codes":[]},"params":[{"_id":"56da04747222d50b00701668","ref":"","required":false,"desc":"The ID of the webhook to delete","default":"","type":"string","name":"id","in":"path"}],"results":{"codes":[{"name":"","code":"","language":"json","status":204}]},"settings":"57be249fddc0880e006f3b4a","url":"/webhooks/:id"},"body":"Delete a webhook by ID.","category":"571fb615d9baf12900c62a19","createdAt":"2016-03-04T21:56:04.167Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":5,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"delete-webhook","sync_unique":"","title":"Delete webhook","type":"delete","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

deleteDelete webhook


Path Params

id:
string
The ID of the webhook to delete
Delete a webhook by ID.

User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}


Delete a webhook by ID.
{"__v":0,"_id":"571fb616d9baf12900c62a4f","api":{"auth":"never","examples":{"codes":[]},"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"links\": {\n    \"flag-statuses\": {\n      \"href\": \"/api/v2/flag-statuses\",\n      \"type\": \"application/json\"\n    },\n    \"flags\": {\n      \"href\": \"/api/v2/flags\",\n      \"type\": \"application/json\"\n    },\n    \"projects\": {\n      \"href\": \"/api/v2/projects\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/\",\n      \"type\": \"application/json\"\n    }\n  }\n}","name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/"},"body":"You can issue a `GET` request to the root resource to find all of the resource categories supported by the API.","category":"571fb615d9baf12900c62a1f","createdAt":"2014-12-19T18:08:53.466Z","excerpt":"","githubsync":"","hidden":false,"isReference":true,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"root","sync_unique":"","title":"Root resource","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","childrenPages":[]}

getRoot resource


You can issue a `GET` request to the root resource to find all of the resource categories supported by the API.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}

Definition

{{ api_url }}{{ page_api_url }}

Result Format



You can issue a `GET` request to the root resource to find all of the resource categories supported by the API.