{"_id":"571fb616d9baf12900c62a3a","api":{"auth":"required","params":[],"results":{"codes":[{"code":"{}","language":"json","status":200,"name":""},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":""},"excerpt":"","link_external":false,"order":0,"sync_unique":"","type":"basic","__v":1,"category":"571fb615d9baf12900c62a15","isReference":false,"slug":"introduction","link_url":"","user":"5490ae350c7786160022fb4d","updates":[],"body":"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.\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]","createdAt":"2014-12-17T20:52:30.520Z","githubsync":"","hidden":false,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","title":"Introduction","version":"571fb615d9baf12900c62a14","next":{"description":"","pages":[]},"childrenPages":[]}

Introduction


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]
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]
{"_id":"571fb616d9baf12900c62a3b","project":"5490cc10751f9d21005fb9c3","__v":1,"excerpt":"","link_url":"","next":{"description":"","pages":[]},"order":1,"body":"All REST API resources are authenticated with [personal access tokens](https://docs.launchdarkly.com/v2.0/docs/api-access-tokens) or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens 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\": \"[Personal access tokens](https://docs.launchdarkly.com/v2.0/docs/api-access-tokens)\",\n    \"0-1\": \"Can be customized on a per-token basis\",\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 an 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 manage personal access tokens 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","githubsync":"","link_external":false,"hidden":false,"isReference":false,"version":"571fb615d9baf12900c62a14","type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","api":{"params":[],"url":"","results":{"codes":[{"language":"json","status":200,"name":"","code":"{}"},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required"},"parentDoc":null,"slug":"authentication","sync_unique":"","title":"Authentication","childrenPages":[]}

Authentication


All REST API resources are authenticated with [personal access tokens](https://docs.launchdarkly.com/v2.0/docs/api-access-tokens) or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens 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": "[Personal access tokens](https://docs.launchdarkly.com/v2.0/docs/api-access-tokens)", "0-1": "Can be customized on a per-token basis", "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 an 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 manage personal access tokens 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 [personal access tokens](https://docs.launchdarkly.com/v2.0/docs/api-access-tokens) or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens 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": "[Personal access tokens](https://docs.launchdarkly.com/v2.0/docs/api-access-tokens)", "0-1": "Can be customized on a per-token basis", "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 an 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 manage personal access tokens 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.
{"_id":"571fb616d9baf12900c62a3c","order":2,"sync_unique":"","updates":[],"githubsync":"","link_url":"","link_external":false,"parentDoc":null,"slug":"representations","type":"basic","excerpt":"","version":"571fb615d9baf12900c62a14","category":"571fb615d9baf12900c62a15","hidden":false,"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\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.","createdAt":"2014-12-17T23:50:17.485Z","isReference":false,"project":"5490cc10751f9d21005fb9c3","title":"Representations","user":"5490ae350c7786160022fb4d","__v":1,"api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required","params":[],"url":""},"next":{"description":"","pages":[]},"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. 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.
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. 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.
{"_id":"5a568f28799dd6001e1489a5","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"571fb615d9baf12900c62a15","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-10T22:09:44.379Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Resources that accept partial updates use the `PATCH` verb, and support the [JSON Patch](http://tools.ietf.org/html/rfc6902) format. Some resources also support the  [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) format. In addition, some resources support optional comments that can be submitted with updates. Comments appear in outgoing webhooks, the audit log, and other notification systems such as Slack and HipChat. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Updates via JSON patch\"\n}\n[/block]\n[JSON Patch](http://tools.ietf.org/html/rfc6902)  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.\n[block:api-header]\n{\n  \"title\": \"Updates via JSON Merge Patch\"\n}\n[/block]\nThe API also supports the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) format. Currently, the [Update feature flag](doc:update-feature-flag) resource supports JSON Merge Patch, and support in other `PATCH` resources is forthcoming. \n\nJSON Merge Patch is less expressive than JSON Patch, but in many cases it is simpler to construct a merge patch document. For example, we can change a feature flag's description with the following merge patch document:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"description\\\": \\\"New flag description\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Updates with comments\"\n}\n[/block]\nYou can submit optional comments with `PATCH` changes. Currently, the [Update feature flag](doc:update-feature-flag) resource supports comments, and support in other `PATCH` resources is forthcoming. \n\nTo submit a comment along with a JSON Patch document, use the following format:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"comment\\\": \\\"This is a comment string\\\",\\n  \\\"patch\\\": [ {\\\"op\\\": \\\"replace\\\", \\\"path\\\": \\\"/description\\\", \\\"value\\\": \\\"The new description\\\" } ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nTo submit a comment along with a JSON Merge Patch document, use the following format:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"comment\\\": \\\"This is a comment string\\\",\\n  \\\"merge\\\": { \\\"description\\\": \\\"New flag description\\\"}\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"updates","type":"basic","title":"Updates","__v":0,"parentDoc":null,"childrenPages":[]}

Updates


Resources that accept partial updates use the `PATCH` verb, and support the [JSON Patch](http://tools.ietf.org/html/rfc6902) format. Some resources also support the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) format. In addition, some resources support optional comments that can be submitted with updates. Comments appear in outgoing webhooks, the audit log, and other notification systems such as Slack and HipChat. [block:api-header] { "type": "basic", "title": "Updates via JSON patch" } [/block] [JSON Patch](http://tools.ietf.org/html/rfc6902) 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. [block:api-header] { "title": "Updates via JSON Merge Patch" } [/block] The API also supports the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) format. Currently, the [Update feature flag](doc:update-feature-flag) resource supports JSON Merge Patch, and support in other `PATCH` resources is forthcoming. JSON Merge Patch is less expressive than JSON Patch, but in many cases it is simpler to construct a merge patch document. For example, we can change a feature flag's description with the following merge patch document: [block:code] { "codes": [ { "code": "{\n \"description\": \"New flag description\"\n}", "language": "json" } ] } [/block] [block:api-header] { "title": "Updates with comments" } [/block] You can submit optional comments with `PATCH` changes. Currently, the [Update feature flag](doc:update-feature-flag) resource supports comments, and support in other `PATCH` resources is forthcoming. To submit a comment along with a JSON Patch document, use the following format: [block:code] { "codes": [ { "code": "{\n \"comment\": \"This is a comment string\",\n \"patch\": [ {\"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" } ]\n}", "language": "json" } ] } [/block] To submit a comment along with a JSON Merge Patch document, use the following format: [block:code] { "codes": [ { "code": "{\n \"comment\": \"This is a comment string\",\n \"merge\": { \"description\": \"New flag description\"}\n}", "language": "json" } ] } [/block]
Resources that accept partial updates use the `PATCH` verb, and support the [JSON Patch](http://tools.ietf.org/html/rfc6902) format. Some resources also support the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) format. In addition, some resources support optional comments that can be submitted with updates. Comments appear in outgoing webhooks, the audit log, and other notification systems such as Slack and HipChat. [block:api-header] { "type": "basic", "title": "Updates via JSON patch" } [/block] [JSON Patch](http://tools.ietf.org/html/rfc6902) 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. [block:api-header] { "title": "Updates via JSON Merge Patch" } [/block] The API also supports the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) format. Currently, the [Update feature flag](doc:update-feature-flag) resource supports JSON Merge Patch, and support in other `PATCH` resources is forthcoming. JSON Merge Patch is less expressive than JSON Patch, but in many cases it is simpler to construct a merge patch document. For example, we can change a feature flag's description with the following merge patch document: [block:code] { "codes": [ { "code": "{\n \"description\": \"New flag description\"\n}", "language": "json" } ] } [/block] [block:api-header] { "title": "Updates with comments" } [/block] You can submit optional comments with `PATCH` changes. Currently, the [Update feature flag](doc:update-feature-flag) resource supports comments, and support in other `PATCH` resources is forthcoming. To submit a comment along with a JSON Patch document, use the following format: [block:code] { "codes": [ { "code": "{\n \"comment\": \"This is a comment string\",\n \"patch\": [ {\"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" } ]\n}", "language": "json" } ] } [/block] To submit a comment along with a JSON Merge Patch document, use the following format: [block:code] { "codes": [ { "code": "{\n \"comment\": \"This is a comment string\",\n \"merge\": { \"description\": \"New flag description\"}\n}", "language": "json" } ] } [/block]
{"_id":"571fb616d9baf12900c62a3d","link_url":"","slug":"errors","user":"5490ae350c7786160022fb4d","category":"571fb615d9baf12900c62a15","createdAt":"2014-12-17T23:50:27.557Z","excerpt":"","githubsync":"","hidden":false,"updates":["5a27dbff7ce7220030fbddd4"],"api":{"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"status":400,"name":"","code":"{}","language":"json"}]},"auth":"required","params":[],"url":""},"order":4,"project":"5490cc10751f9d21005fb9c3","title":"Errors","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.","link_external":false,"sync_unique":"","version":"571fb615d9baf12900c62a14","__v":1,"isReference":false,"parentDoc":null,"type":"basic","next":{"pages":[]},"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.
{"_id":"571fb616d9baf12900c62a3e","excerpt":"","isReference":false,"link_external":false,"project":"5490cc10751f9d21005fb9c3","updates":[],"createdAt":"2015-05-19T00:46:07.225Z","title":"CORS","type":"basic","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","hidden":false,"order":5,"sync_unique":"","version":"571fb615d9baf12900c62a14","__v":0,"api":{"results":{"codes":[{"status":200,"name":"","code":"{}","language":"json"},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required","params":[],"url":""},"parentDoc":null,"slug":"cors","user":"5490ae350c7786160022fb4d","githubsync":"","link_url":"","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.
{"_id":"59b060c2ce013c0010694890","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"571fb615d9baf12900c62a15","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-06T20:55:30.354Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"We use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs will return a `429` status code. Calls to our APIs will include headers indicating the current rate limit status. The specific headers returned depend on the API route being called-- the limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Rate limiting and SDKs\",\n  \"body\": \"Our SDKs are never rate limited. Our SDKs do not use the API endpoints defined here-- we use a different set of approaches (streaming / server-sent events as well as a global CDN) to ensure availability to the routes used by our SDKs.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Global rate limits\"\n}\n[/block]\nAuthenticated requests are subject to a global limit-- this is the maximum number of calls that can be made to the API per minute. All personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits will return the headers below:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Header name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`X-RateLimit-Global-Remaining`\",\n    \"1-0\": \"`X-RateLimit-Reset`\",\n    \"0-1\": \"The maximum number of requests the account is permitted to make per minute.\",\n    \"1-1\": \"The time at which the current rate limit window resets in epoch milliseconds.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Route-level rate limits\"\n}\n[/block]\nSome authenticated routes have custom rate limits. These also reset every minute. Any access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits will return the headers below:\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`X-RateLimit-Route-Remaining`\",\n    \"1-0\": \"`X-RateLimit-Reset`\",\n    \"0-1\": \"The maximum number of requests to the current route the account is permitted to make per minute.\",\n    \"1-1\": \"The time at which the current rate limit window resets in epoch milliseconds.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\nA *route* represents a specific URL pattern and verb. For example, the [Delete environment](doc:delete-environment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route. \n[block:api-header]\n{\n  \"title\": \"IP-based rate limiting\"\n}\n[/block]\nWe also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again.","excerpt":"","slug":"rate-limiting","type":"basic","title":"Rate limiting","__v":2,"parentDoc":null,"childrenPages":[]}

Rate limiting


We use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs will return a `429` status code. Calls to our APIs will include headers indicating the current rate limit status. The specific headers returned depend on the API route being called-- the limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below. [block:callout] { "type": "warning", "title": "Rate limiting and SDKs", "body": "Our SDKs are never rate limited. Our SDKs do not use the API endpoints defined here-- we use a different set of approaches (streaming / server-sent events as well as a global CDN) to ensure availability to the routes used by our SDKs." } [/block] [block:api-header] { "title": "Global rate limits" } [/block] Authenticated requests are subject to a global limit-- this is the maximum number of calls that can be made to the API per minute. All personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits will return the headers below: [block:parameters] { "data": { "h-0": "Header name", "h-1": "Description", "0-0": "`X-RateLimit-Global-Remaining`", "1-0": "`X-RateLimit-Reset`", "0-1": "The maximum number of requests the account is permitted to make per minute.", "1-1": "The time at which the current rate limit window resets in epoch milliseconds." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "title": "Route-level rate limits" } [/block] Some authenticated routes have custom rate limits. These also reset every minute. Any access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits will return the headers below: [block:parameters] { "data": { "0-0": "`X-RateLimit-Route-Remaining`", "1-0": "`X-RateLimit-Reset`", "0-1": "The maximum number of requests to the current route the account is permitted to make per minute.", "1-1": "The time at which the current rate limit window resets in epoch milliseconds." }, "cols": 2, "rows": 2 } [/block] A *route* represents a specific URL pattern and verb. For example, the [Delete environment](doc:delete-environment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route. [block:api-header] { "title": "IP-based rate limiting" } [/block] We also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again.
We use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs will return a `429` status code. Calls to our APIs will include headers indicating the current rate limit status. The specific headers returned depend on the API route being called-- the limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below. [block:callout] { "type": "warning", "title": "Rate limiting and SDKs", "body": "Our SDKs are never rate limited. Our SDKs do not use the API endpoints defined here-- we use a different set of approaches (streaming / server-sent events as well as a global CDN) to ensure availability to the routes used by our SDKs." } [/block] [block:api-header] { "title": "Global rate limits" } [/block] Authenticated requests are subject to a global limit-- this is the maximum number of calls that can be made to the API per minute. All personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits will return the headers below: [block:parameters] { "data": { "h-0": "Header name", "h-1": "Description", "0-0": "`X-RateLimit-Global-Remaining`", "1-0": "`X-RateLimit-Reset`", "0-1": "The maximum number of requests the account is permitted to make per minute.", "1-1": "The time at which the current rate limit window resets in epoch milliseconds." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "title": "Route-level rate limits" } [/block] Some authenticated routes have custom rate limits. These also reset every minute. Any access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits will return the headers below: [block:parameters] { "data": { "0-0": "`X-RateLimit-Route-Remaining`", "1-0": "`X-RateLimit-Reset`", "0-1": "The maximum number of requests to the current route the account is permitted to make per minute.", "1-1": "The time at which the current rate limit window resets in epoch milliseconds." }, "cols": 2, "rows": 2 } [/block] A *route* represents a specific URL pattern and verb. For example, the [Delete environment](doc:delete-environment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route. [block:api-header] { "title": "IP-based rate limiting" } [/block] We also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again.
{"_id":"59b975f9f387380010cd1621","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"571fb615d9baf12900c62a15","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-13T18:16:25.891Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"We have a complete Open API (Swagger) specification for our API hosted here:\n\n[LaunchDarkly OpenAPI specification](https://launchdarkly.github.io/ld-openapi/swagger.yaml)\n\nThis specification is generated from the [ld-openapi repository on GitHub](https://github.com/launchdarkly/ld-openapi). \n\nYou can use this specification to generate client libraries to interact with our REST API in your language of choice. We plan on publishing these client libraries and hosting them ourselves soon.","excerpt":"","slug":"open-api-swagger","type":"basic","title":"Open API (Swagger)","__v":0,"parentDoc":null,"childrenPages":[]}

Open API (Swagger)


We have a complete Open API (Swagger) specification for our API hosted here: [LaunchDarkly OpenAPI specification](https://launchdarkly.github.io/ld-openapi/swagger.yaml) This specification is generated from the [ld-openapi repository on GitHub](https://github.com/launchdarkly/ld-openapi). You can use this specification to generate client libraries to interact with our REST API in your language of choice. We plan on publishing these client libraries and hosting them ourselves soon.
We have a complete Open API (Swagger) specification for our API hosted here: [LaunchDarkly OpenAPI specification](https://launchdarkly.github.io/ld-openapi/swagger.yaml) This specification is generated from the [ld-openapi repository on GitHub](https://github.com/launchdarkly/ld-openapi). You can use this specification to generate client libraries to interact with our REST API in your language of choice. We plan on publishing these client libraries and hosting them ourselves soon.
{"_id":"5ad9033bb0717d0003b9f2a6","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"571fb615d9baf12900c62a15","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-04-19T20:59:39.493Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `PUT`, `PATCH`, and `DELETE` verbs will be inaccessible.\n\nTo avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `PUT`, `PATCH`, and `DELETE` requests via a `POST` request. \n\nFor example, if you wish to call one of our `PATCH` resources via a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header.","excerpt":"","slug":"method-overriding","type":"basic","title":"Method Overriding","__v":0,"childrenPages":[]}

Method Overriding


Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `PUT`, `PATCH`, and `DELETE` verbs will be inaccessible. To avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to "tunnel" `PUT`, `PATCH`, and `DELETE` requests via a `POST` request. For example, if you wish to call one of our `PATCH` resources via a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header.
Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `PUT`, `PATCH`, and `DELETE` verbs will be inaccessible. To avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to "tunnel" `PUT`, `PATCH`, and `DELETE` requests via a `POST` request. For example, if you wish to call one of our `PATCH` resources via a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header.
{"_id":"57be1234fc5c4b1700ca6dd1","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.","isReference":true,"order":0,"type":"basic","updates":[],"user":"5490ae350c7786160022fb4d","__v":0,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"parentDoc":null,"excerpt":"","hidden":false,"link_url":"","project":"5490cc10751f9d21005fb9c3","title":"Projects overview","version":"571fb615d9baf12900c62a14","sync_unique":"","category":"578d6fc62441e13200a14321","createdAt":"2016-08-24T21:31:32.872Z","githubsync":"","link_external":false,"slug":"projects-overview","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.
{"_id":"57be1544e6b5cb19001bb92f","body":"Returns a list of all projects in the account.","category":"578d6fc62441e13200a14321","githubsync":"","order":1,"slug":"list-projects","title":"List projects","updates":[],"__v":0,"user":"5490ae350c7786160022fb4d","api":{"url":"/projects","auth":"required","examples":{"codes":[]},"method":"get","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"},"hidden":false,"link_external":false,"project":"5490cc10751f9d21005fb9c3","sync_unique":"","type":"get","version":"571fb615d9baf12900c62a14","createdAt":"2016-08-24T21:44:36.098Z","excerpt":"","isReference":true,"link_url":"","parentDoc":null,"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.
{"_id":"57be163f7987bf170063fa0c","excerpt":"","link_url":"","next":{"description":"","pages":[]},"updates":[],"createdAt":"2016-08-24T21:48:47.195Z","githubsync":"","parentDoc":null,"title":"Get project","version":"571fb615d9baf12900c62a14","slug":"get-project","__v":2,"api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[{"required":false,"type":"string","_id":"57be1749e6b5cb19001bb931","default":"","desc":"The project key","in":"path","name":"projKey","ref":""}],"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  \"includeInSnippetByDefault\": false,\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","hidden":false,"isReference":true,"project":"5490cc10751f9d21005fb9c3","sync_unique":"","type":"get","link_external":false,"order":2,"user":"5490ae350c7786160022fb4d","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.
{"_id":"57be1a0615efc70e006a5f94","createdAt":"2016-08-24T22:04:54.643Z","title":"Create project","updates":[],"user":"5490ae350c7786160022fb4d","excerpt":"","githubsync":"","parentDoc":null,"sync_unique":"","type":"post","order":3,"project":"5490cc10751f9d21005fb9c3","api":{"auth":"required","examples":{"codes":[]},"method":"post","params":[{"in":"body","required":false,"desc":"The name of the new project","default":"","type":"string","name":"name","_id":"57be1df4c248140e00858133","ref":""},{"required":false,"desc":"A unique key for the new project","default":"","type":"string","name":"key","_id":"57be1df4c248140e00858132","ref":"","in":"body"}],"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","isReference":true,"link_external":false,"link_url":"","slug":"create-project","__v":1,"hidden":false,"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.
{"_id":"57be20af15efc70e006a5f9e","title":"Update project","__v":5,"body":"Update a project. Requires a [JSON Patch](https://tools.ietf.org/html/rfc6902) representation of the desired changes to the project.","category":"578d6fc62441e13200a14321","link_external":false,"project":"5490cc10751f9d21005fb9c3","type":"patch","api":{"examples":{"codes":[{"language":"json","code":"[\n  {\"op\": \"replace\", \"path\": \"/name\", \"value\": \"New project name\"}\n]"}]},"method":"patch","params":[{"required":false,"type":"string","_id":"57be20e1c90f500e0082a3a7","default":"","desc":"The project's key","in":"path","name":"projKey","ref":""}],"results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"code":"{\n  \"message\": \"Unsupported json-patch operation\"\n}","language":"json","status":400,"name":""}]},"settings":"57be24d969196d0e00d0b5de","url":"/projects/:projKey","auth":"required"},"excerpt":"","githubsync":"","sync_unique":"","user":"5490ae350c7786160022fb4d","createdAt":"2016-08-24T22:33:19.255Z","hidden":false,"isReference":true,"link_url":"","parentDoc":null,"order":4,"slug":"update-project","updates":[],"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.
{"_id":"57be1f83c248140e00858137","updates":[],"createdAt":"2016-08-24T22:28:19.870Z","link_external":false,"order":5,"sync_unique":"","excerpt":"","type":"delete","version":"571fb615d9baf12900c62a14","link_url":"","project":"5490cc10751f9d21005fb9c3","api":{"settings":"57be249fddc0880e006f3b4a","url":"/projects/:projKey","auth":"required","examples":{"codes":[]},"method":"delete","params":[{"desc":"The key of the project to delete","in":"path","name":"projKey","ref":"","required":false,"type":"string","_id":"57be202fddc0880e006f3b42","default":""}],"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}]}},"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","parentDoc":null,"slug":"delete-project","title":"Delete project","user":"5490ae350c7786160022fb4d","__v":1,"githubsync":"","hidden":false,"isReference":true,"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.
{"_id":"57be348ac90f500e0082a3bd","api":{"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","auth":"required","params":[]},"createdAt":"2016-08-24T23:58:02.140Z","excerpt":"","updates":[],"sync_unique":"","__v":0,"githubsync":"","hidden":false,"link_url":"","order":0,"project":"5490cc10751f9d21005fb9c3","category":"578d6fd021c6a81900ba272e","parentDoc":null,"slug":"environments-overview","type":"basic","version":"571fb615d9baf12900c62a14","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.","isReference":true,"link_external":false,"title":"Environments overview","user":"5490ae350c7786160022fb4d","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.
{"_id":"57be2c3769196d0e00d0b5e3","__v":0,"body":"Get an environment given a project and key.","excerpt":"","link_external":false,"user":"5490ae350c7786160022fb4d","hidden":false,"isReference":true,"sync_unique":"","title":"Get environment","type":"get","category":"578d6fd021c6a81900ba272e","parentDoc":null,"slug":"get-environment","order":1,"project":"5490cc10751f9d21005fb9c3","updates":[],"api":{"results":{"codes":[{"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,"name":""},{"status":404,"language":"text","code":"{\n    \"message\": \"Unknown environment key :envKey\"\n}"}]},"settings":"57be249fddc0880e006f3b4a","url":"/projects/:projKey/environments/:envKey","auth":"required","examples":{"codes":[]},"method":"get","params":[{"ref":"","required":false,"type":"string","_id":"57be2c3769196d0e00d0b5e5","default":"","desc":"The project key","in":"path","name":"projKey"},{"desc":"The environment key","in":"path","name":"envKey","ref":"","required":false,"type":"string","_id":"57be2c3769196d0e00d0b5e4","default":""}]},"createdAt":"2016-08-24T23:22:31.043Z","githubsync":"","link_url":"","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.
{"_id":"57be2d7c15efc70e006a5fac","link_external":false,"parentDoc":null,"slug":"create-environment","title":"Create environment","type":"post","version":"571fb615d9baf12900c62a14","category":"578d6fd021c6a81900ba272e","api":{"settings":"57be2876ddc0880e006f3b4d","url":"/projects/:projKey/environments","auth":"required","examples":{"codes":[{"language":"json","code":"{\n  \"name\" : \"New environment\",\n  \"key\" : \"new-environment\",\n  \"color\": \"C8C8C8\"\n}"}]},"method":"post","params":[{"default":"","type":"string","name":"projKey","_id":"57be2db3cb27950e00ceee18","ref":"","in":"path","required":true,"desc":"The project key"},{"in":"body","required":true,"desc":"The name of the new environment","default":"","type":"string","name":"name","_id":"57be2e6fc248140e00858159","ref":""},{"desc":"A project-unique key for the new environment","default":"","type":"string","name":"key","_id":"57be2e6fc248140e00858158","ref":"","in":"body","required":true},{"_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"},{"name":"defaultTtl","_id":"57be2e6fc248140e00858156","ref":"","in":"body","required":false,"desc":"The default TTL for the new environment","default":"","type":"int"}],"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":""},{"code":"{\n  \"message\": \"Missing field name\"\n}","name":"","status":400,"language":"json"},{"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}"}]}},"createdAt":"2016-08-24T23:27:56.201Z","hidden":false,"isReference":true,"project":"5490cc10751f9d21005fb9c3","sync_unique":"","user":"5490ae350c7786160022fb4d","githubsync":"","order":2,"body":"Create a new environment in a specified project with a given name, key, swatch color, and default TTL.","excerpt":"","link_url":"","updates":[],"__v":2,"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.
{"_id":"57be6eb4b01e580e0043c613","slug":"update-environment","type":"patch","hidden":false,"order":3,"isReference":true,"api":{"auth":"required","examples":{"codes":[{"language":"json","code":"[\n  {\"op\": \"replace\", \"path\": \"/secureMode\", \"value\": true} \n]"}]},"method":"patch","params":[{"type":"string","name":"projKey","_id":"57be6f6afd5b9d0e00c551cc","ref":"","in":"path","required":true,"desc":"The project key","default":""},{"desc":"The environment key","default":"","type":"string","name":"envKey","_id":"57be6f6afd5b9d0e00c551cb","ref":"","in":"path","required":true}],"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"},"excerpt":"","category":"578d6fd021c6a81900ba272e","githubsync":"","link_external":false,"link_url":"","parentDoc":null,"project":"5490cc10751f9d21005fb9c3","__v":1,"body":"","updates":[],"sync_unique":"","title":"Update environment","user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","createdAt":"2016-08-25T04:06:12.105Z","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



{"_id":"57be3480ddc0880e006f3b56","body":"Delete an environment in a specified project.","excerpt":"","isReference":true,"link_external":false,"link_url":"","parentDoc":null,"project":"5490cc10751f9d21005fb9c3","slug":"delete-environment","sync_unique":"","type":"delete","updates":[],"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","__v":0,"category":"578d6fd021c6a81900ba272e","createdAt":"2016-08-24T23:57:52.967Z","hidden":false,"title":"Delete environment","api":{"params":[{"ref":"","in":"path","required":false,"desc":"The project key","default":"","type":"string","name":"projKey","_id":"57be3480ddc0880e006f3b58"},{"in":"path","required":false,"desc":"The environment key","default":"","type":"string","name":"envKey","_id":"57be3480ddc0880e006f3b57","ref":""}],"results":{"codes":[{"status":204,"language":"json","code":"","name":""},{"language":"json","code":"{}","name":"","status":404}]},"settings":"57be249fddc0880e006f3b4a","url":"/projects/:projKey/environments/:envKey","auth":"required","examples":{"codes":[]},"method":"delete"},"githubsync":"","order":4,"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.
{"_id":"571fb615d9baf12900c62a20","category":"571fb615d9baf12900c62a16","createdAt":"2014-12-19T18:15:12.584Z","hidden":false,"isReference":true,"project":"5490cc10751f9d21005fb9c3","__v":0,"api":{"auth":"required","params":[],"results":{"codes":[{"language":"json","status":200,"name":"","code":"{}"},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":"","url":""},"excerpt":"","sync_unique":"","updates":[],"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%.","link_url":"","order":0,"parentDoc":null,"title":"Feature flags overview","type":"basic","user":"5490ae350c7786160022fb4d","githubsync":"","link_external":false,"slug":"feature-flags-overview","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%.
{"_id":"571fb615d9baf12900c62a21","project":"5490cc10751f9d21005fb9c3","sync_unique":"","title":"List feature flags","createdAt":"2014-12-17T21:03:59.938Z","githubsync":"","parentDoc":null,"link_external":false,"type":"get","user":"5490ae350c7786160022fb4d","__v":2,"api":{"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","auth":"required","examples":{"codes":[]},"method":"get","params":[{"required":true,"desc":"The project key","default":"","type":"string","name":"projKey","_id":"57c120c1d796900e0025001f","ref":"","in":"path"},{"ref":"","in":"query","required":false,"desc":"Filter configurations by environment","default":"","type":"string","name":"env","_id":"57c120c1d796900e0025001e"},{"default":"","type":"string","name":"tag","_id":"58ab3317b435800f00c02cde","ref":"","in":"query","required":false,"desc":"Filter feature flags by tag"}]},"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.","excerpt":"","hidden":false,"order":1,"slug":"list-feature-flags","updates":[],"category":"571fb615d9baf12900c62a16","isReference":true,"link_url":"","next":{"description":"","pages":[]},"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.
{"_id":"571fb615d9baf12900c62a22","link_url":"","project":"5490cc10751f9d21005fb9c3","type":"get","category":"571fb615d9baf12900c62a16","excerpt":"","editedParams":true,"githubsync":"","order":2,"parentDoc":null,"slug":"get-feature-flag","version":"571fb615d9baf12900c62a14","__v":2,"createdAt":"2014-12-17T21:14:00.819Z","user":"5490ae350c7786160022fb4d","hidden":false,"isReference":true,"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.","editedParams2":true,"link_external":false,"sync_unique":"","title":"Get feature flag","updates":[],"api":{"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","auth":"required","examples":{"codes":[]},"method":"get","params":[{"type":"string","name":"projKey","_id":"57c1210bab303e0e0010735d","ref":"","in":"path","required":true,"desc":"The project key","default":""},{"required":true,"desc":"The feature flag key","default":"","type":"string","name":"key","_id":"5491f2184311181600198e69","ref":"","in":"path"},{"default":"","desc":"Filter configurations by environment","in":"query","name":"env","ref":"","required":false,"type":"string","_id":"57c1218f9244210e00e6ff0b"}]},"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.
{"_id":"571fb615d9baf12900c62a23","order":3,"project":"5490cc10751f9d21005fb9c3","sync_unique":"","type":"post","editedParams2":true,"hidden":false,"link_external":false,"version":"571fb615d9baf12900c62a14","user":"5490ae350c7786160022fb4d","__v":5,"isReference":true,"slug":"create-feature-flag","title":"Create feature flag","excerpt":"","updates":["582dd4f70adc11230047890e"],"api":{"results":{"codes":[{"code":"{\n   \"name\":\"New test flag\",\n   \"key\":\"new-test-flag\",\n   \"on\":true,\n  ...\n}","language":"json","status":201,"name":""},{"language":"json","status":409,"name":null,"code":"{\n  \"message\": \"Duplicate feature key\"\n}"}]},"settings":"57be2876ddc0880e006f3b4d","url":"/flags/:projKey","auth":"required","examples":{"codes":[{"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}","language":"json"}]},"method":"post","params":[{"default":"","type":"string","name":"name","_id":"549250daccf2070b002a17ed","ref":"","in":"body","required":true,"desc":"A human-friendly name for the feature flag"},{"default":"","type":"string","name":"key","_id":"549250daccf2070b002a17ec","ref":"","in":"body","required":true,"desc":"A unique key that will be used to reference the flag in your code"},{"default":"","type":"array_object","name":"variations","_id":"549250daccf2070b002a17ea","ref":"","in":"body","required":true,"desc":"An array of possible variations for the flag."},{"in":"body","required":true,"desc":"The value of the flag for this variation","default":"","type":"mixed","name":"variations[value]","_id":"549250daccf2070b002a17e9","ref":""},{"desc":"A description for the variation","default":"","type":"string","name":"variations[description]","_id":"549250daccf2070b002a17e8","ref":"","in":"body","required":false},{"_id":"54949a475051740b00ab7d41","ref":"","in":"body","required":false,"desc":"A name for the variation","default":"","type":"array_mixed","name":"variations[name]"},{"name":"projKey","_id":"57c12242a3ba0b0e00eb11e1","ref":"","in":"path","required":false,"desc":"The project key","default":"","type":"string"},{"type":"boolean","name":"temporary","_id":"57c122e8d796900e00250022","ref":"","in":"body","required":false,"desc":"Whether or not the flag is a temporary flag","default":""},{"desc":"Tags for the feature flag","default":"","type":"array_string","name":"tags","_id":"57c122e8d796900e00250021","ref":"","in":"body","required":false},{"name":"includeInSnippet","_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"}]},"body":"Creates a new feature flag.","createdAt":"2014-12-18T03:58:18.917Z","editedParams":true,"category":"571fb615d9baf12900c62a16","githubsync":"","link_url":"","parentDoc":null,"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.
{"_id":"571fb615d9baf12900c62a24","link_url":"","parentDoc":null,"api":{"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},{"status":400,"name":"","code":"{\n  \"message\": \"Invalid json-patch document\"\n}","language":"json"}]},"settings":"57be24d969196d0e00d0b5de","url":"/flags/:projKey/:key","auth":"required","examples":{"codes":[{"language":"json","code":"[\n  { \"op\": \"replace\", \"path\": \"/environments/production/on\", \"value\": false }\n]"}]},"method":"patch"},"body":"Perform a partial update to a feature. The request body must be a valid [JSON Patch](https://tools.ietf.org/html/rfc6902) or  [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) document.\n\nYou can optionally submit a comment (which appears in the audit log, as well as webhook, Slack, and HipChat notifications) along with the partial update request. For more information on supported options, see the [Updates](doc:updates) section of our API documentation.","createdAt":"2014-12-18T04:09:21.470Z","order":4,"sync_unique":"","type":"patch","user":"5490ae350c7786160022fb4d","__v":2,"excerpt":"","githubsync":"","project":"5490cc10751f9d21005fb9c3","editedParams":true,"editedParams2":true,"link_external":false,"isReference":true,"slug":"update-feature-flag","title":"Update feature flag","updates":[],"version":"571fb615d9baf12900c62a14","category":"571fb615d9baf12900c62a16","hidden":false,"next":{"description":"","pages":[]},"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) or [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) document. You can optionally submit a comment (which appears in the audit log, as well as webhook, Slack, and HipChat notifications) along with the partial update request. For more information on supported options, see the [Updates](doc:updates) section of our API documentation.

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) or [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) document. You can optionally submit a comment (which appears in the audit log, as well as webhook, Slack, and HipChat notifications) along with the partial update request. For more information on supported options, see the [Updates](doc:updates) section of our API documentation.
{"_id":"571fb615d9baf12900c62a25","link_url":"","project":"5490cc10751f9d21005fb9c3","api":{"params":[{"ref":"","in":"path","required":false,"desc":"The project key","default":"","type":"string","name":"projKey","_id":"57c121baab303e0e0010735e"},{"in":"path","required":true,"desc":"The key of the feature flag to delete","default":"","type":"string","name":"key","_id":"54925320ccf2070b002a17ef","ref":""}],"results":{"codes":[{"name":"","code":"","language":"json","status":204}]},"settings":"57be249fddc0880e006f3b4a","url":"/flags/:projKey/:key","auth":"required","examples":{"codes":[]},"method":"delete"},"excerpt":"","hidden":false,"isReference":true,"link_external":false,"type":"delete","editedParams":true,"githubsync":"","updates":[],"__v":2,"category":"571fb615d9baf12900c62a16","order":5,"parentDoc":null,"slug":"delete-feature-flag","user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","body":"Delete a feature flag in **all** environments. Be careful-- only delete feature flags that are no longer being used by your application.","createdAt":"2014-12-18T04:08:00.484Z","editedParams2":true,"next":{"description":"","pages":[]},"sync_unique":"","title":"Delete feature flag","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.
{"_id":"571fb615d9baf12900c62a26","githubsync":"","isReference":true,"link_external":false,"link_url":"","parentDoc":null,"__v":1,"category":"571fb615d9baf12900c62a16","createdAt":"2016-02-08T19:44:13.458Z","user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","sync_unique":"","title":"List feature flag statuses","type":"get","order":6,"slug":"list-feature-flag-statuses","updates":[],"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","excerpt":"","hidden":false,"api":{"params":[{"ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey","_id":"57c124786df4490e00834137"},{"default":"","type":"string","name":"envKey","_id":"57c124786df4490e00834136","ref":"","in":"path","required":true,"desc":"The environment key"}],"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","auth":"required","examples":{"codes":[]},"method":"get"},"project":"5490cc10751f9d21005fb9c3","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
{"_id":"571fb615d9baf12900c62a27","editedParams2":true,"excerpt":"","isReference":true,"category":"571fb615d9baf12900c62a16","hidden":false,"parentDoc":null,"slug":"get-feature-flag-status","sync_unique":"","title":"Get feature flag status","user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","createdAt":"2016-02-08T19:53:30.773Z","editedParams":true,"githubsync":"","link_url":"","order":7,"updates":[],"api":{"params":[{"type":"string","name":"projKey","_id":"57c124e46df4490e00834139","ref":"","in":"path","required":true,"desc":"The project key","default":""},{"desc":"The environment key","default":"","type":"string","name":"envKey","_id":"57c124e46df4490e00834138","ref":"","in":"path","required":true},{"name":"key","_id":"56b8f23a578edc0d0023cf4f","ref":"","in":"path","required":true,"desc":"The key of the feature flag","default":"","type":"string"}],"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","auth":"required","examples":{"codes":[]},"method":"get"},"body":"Get the status for a particular feature flag.","link_external":false,"project":"5490cc10751f9d21005fb9c3","type":"get","__v":1,"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.
{"_id":"5aa81442dd441c009cb09417","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5aa80ac280914c00723eeed6","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-03-13T18:11:14.560Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Segments allow you to create targeting rules and lists of users that can be shared by one or more feature flags in an environment. Creating a segment is a lot like creating a flag. You can include individual users from a segment. You can also create targeting rules, same as those for flags, that include or exclude users based on attributes your application has provided about those users. Finally, you can explicitly exclude users that would otherwise be included by those rules.\n\nThe segments API allows you to list, create, modify, and delete segments programmatically.","excerpt":"","slug":"segments-overview","type":"basic","title":"Segments overview","__v":0,"parentDoc":null,"childrenPages":[]}

Segments overview


Segments allow you to create targeting rules and lists of users that can be shared by one or more feature flags in an environment. Creating a segment is a lot like creating a flag. You can include individual users from a segment. You can also create targeting rules, same as those for flags, that include or exclude users based on attributes your application has provided about those users. Finally, you can explicitly exclude users that would otherwise be included by those rules. The segments API allows you to list, create, modify, and delete segments programmatically.
Segments allow you to create targeting rules and lists of users that can be shared by one or more feature flags in an environment. Creating a segment is a lot like creating a flag. You can include individual users from a segment. You can also create targeting rules, same as those for flags, that include or exclude users based on attributes your application has provided about those users. Finally, you can explicitly exclude users that would otherwise be included by those rules. The segments API allows you to list, create, modify, and delete segments programmatically.
{"_id":"5aa80dbae01368006f54c21f","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5aa80ac280914c00723eeed6","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-03-13T17:43:22.193Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"items\": [\n    {\n      \"name\": \"Example Segment\",\n      \"description\": \"This is my segment\",\n      \"tags\": [\n        \"segment-tag\"\n      ],\n      \"creationDate\": 1520375474842,\n      \"key\": \"example-segment\",\n      \"included\": [\n        \"someUser\",\n        \"anotherUser\"\n      ],\n      \"excluded\": [\n        \"aThirdUser\",\n      ],\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/segments/default/production\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/segments/default/production/example-segment\",\n          \"type\": \"application/json\"\n        },\n        \"site\": {\n          \"href\": \"/default/production/segments/example-segment\",\n          \"type\": \"text/html\"\n        }\n      },\n      \"rules\": [],\n      \"version\": 3,\n      \"deleted\": false\n    },\n    {\n      \"name\": \"Example Segment 2\",\n      \"description\": \"This is my other segment\",\n      \"tags\": [\n        \"segment-tag\"\n      ],\n      \"creationDate\": 1520375480875,\n      \"key\": \"example-segment-2\",\n      \"included\": [\n        \"aFourthUser\"\n      ],\n      \"excluded\": [],\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/segments/default/production\",\n          \"type\": \"application/json\"\n        },\n        \"self\": {\n          \"href\": \"/api/v2/segments/default/production/example-segment\",\n          \"type\": \"application/json\"\n        },\n        \"site\": {\n          \"href\": \"/default/production/segments/example-segment\",\n          \"type\": \"text/html\"\n        }\n      },\n      \"rules\": [],\n      \"version\": 1,\n      \"deleted\": false\n    }\n  ],\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/segments/default\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/segments/default/production\",\n      \"type\": \"application/json\"\n    }\n  }\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"57be249fddc0880e006f3b4a","auth":"required","params":[{"_id":"5aa80e918a1fab003a971935","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"5aa80e918a1fab003a971934","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"}],"url":"/segments/:projKey/:envKey","examples":{"codes":[]},"method":"get"},"isReference":false,"order":2,"body":"","excerpt":"","slug":"list-segments-by-environment","type":"get","title":"List segments","__v":4,"parentDoc":null,"childrenPages":[]}

getList segments


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment 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



{"_id":"5aa80f0b80914c00723eefda","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5aa80ac280914c00723eeed6","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-03-13T17:48:59.858Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"name\": \"Example Segment\",\n  \"description\": \"This is my segment\",\n  \"tags\": [\n    \"segment-tag\"\n  ],\n  \"creationDate\": 1520375474842,\n  \"key\": \"a\",\n  \"included\": [\n    \"someUser\",\n    \"anotherUser\",\n  ],\n  \"excluded\": [\n    \"aThirdUser\"\n  ],\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/segments/default/production\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/segments/default/production/a\",\n      \"type\": \"application/json\"\n    },\n    \"site\": {\n      \"href\": \"/default/production/segments/a\",\n      \"type\": \"text/html\"\n    }\n  },\n  \"rules\": [],\n  \"version\": 2,\n  \"deleted\": false,\n  \"_access\": {\n    \"denied\": []\n  }\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"57be249fddc0880e006f3b4a","auth":"required","params":[{"_id":"5aa80f0b80914c00723eefdd","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"5aa80f0b80914c00723eefdc","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"5aa80f0b80914c00723eefdb","ref":"","in":"path","required":true,"desc":"The segment key","default":"","type":"string","name":"key"}],"url":"/segments/:projKey/:envKey/:key","method":"get"},"isReference":false,"order":3,"body":"","excerpt":"","slug":"get-segment","type":"get","title":"Get segment","__v":2,"parentDoc":null,"childrenPages":[]}

getGet segment


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key
key:
required
string
The segment 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



{"_id":"5aa810b5cadf500091c2767d","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5aa80ac280914c00723eeed6","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-03-13T17:56:05.460Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"post","examples":{"codes":[]},"results":{"codes":[{"name":"","code":"{\n  \"name\": \"Example Segment\",\n  \"description\": \"This is my segment\",\n  \"tags\": [\n    \"segment-tag\"\n  ],\n  \"creationDate\": 1520963745670,\n  \"key\": \"example-segment\",\n  \"included\": [],\n  \"excluded\": [],\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/segments/default/production\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/segments/default/production/example-segment\",\n      \"type\": \"application/json\"\n    },\n    \"site\": {\n      \"href\": \"/default/production/segments/example-segment\",\n      \"type\": \"text/html\"\n    }\n  },\n  \"rules\": [],\n  \"version\": 1,\n  \"deleted\": false\n}","language":"json","status":201},{"name":"","code":"{}","language":"json","status":400}]},"settings":"57be2876ddc0880e006f3b4d","auth":"required","params":[{"_id":"5aa810b5cadf500091c27685","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"5aa810b5cadf500091c27684","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"5aa810b5cadf500091c27682","ref":"","in":"body","required":true,"desc":"A human-friendly name for the segment","default":"","type":"string","name":"name"},{"_id":"5aa810b5cadf500091c27681","ref":"","in":"body","required":true,"desc":"A unique key that will be used to reference the segment","default":"","type":"string","name":"key"},{"_id":"5aa810b5cadf500091c27680","ref":"","in":"body","required":false,"desc":"A description of the segment's purpose","default":"","type":"string","name":"description"},{"_id":"5aa810b5cadf500091c2767f","ref":"","in":"body","required":false,"desc":"Tags for the segment","default":"","type":"array_string","name":"tags"}],"url":"/segments/:projKey/:envKey"},"isReference":false,"order":4,"body":"","excerpt":"","slug":"create-segment","type":"post","title":"Create segment","__v":4,"parentDoc":null,"childrenPages":[]}

postCreate segment


Path Params

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

Body Params

name:
required
string
A human-friendly name for the segment
key:
required
string
A unique key that will be used to reference the segment
description:
string
A description of the segment's purpose
tags:
array of strings
Tags for the segment

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



{"_id":"5aa8132980914c00723ef0f2","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5aa80ac280914c00723eeed6","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-03-13T18:06:33.794Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"patch","examples":{"codes":[{"language":"text","code":"[\n  {\"op\": \"replace\", \"path\": \"/name\", \"value\": \"New segment name\"} \n]"}]},"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"name\": \"New segment name\",\n  \"description\": \"This is my segment\",\n  \"tags\": [\n    \"segment-tag\"\n  ],\n  \"creationDate\": 1520963745670,\n  \"key\": \"example-segment\",\n  \"included\": [],\n  \"excluded\": [],\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/segments/default/production\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/segments/default/production/example-segment\",\n      \"type\": \"application/json\"\n    },\n    \"site\": {\n      \"href\": \"/default/production/segments/example-segment\",\n      \"type\": \"text/html\"\n    }\n  },\n  \"rules\": [],\n  \"version\": 2,\n  \"deleted\": false\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"57be24d969196d0e00d0b5de","auth":"required","params":[{"_id":"5aa8132980914c00723ef0f7","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"5aa8132980914c00723ef0f6","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"5aa8132980914c00723ef0f5","ref":"","in":"path","required":true,"desc":"The segment key","default":"","type":"string","name":"key"}],"url":"/segments/:projKey/:envKey/:key"},"isReference":false,"order":5,"body":"Perform a partial update to a feature. The request body must be a valid [JSON Patch](https://tools.ietf.org/html/rfc6902) or  [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) document.\n\nYou can optionally submit a comment (which appears in the audit log, as well as webhook, Slack, and HipChat notifications) along with the partial update request. For more information on supported options, see the [Updates](doc:updates) section of our API documentation.","excerpt":"","slug":"patch-segment","type":"patch","title":"Patch segment","__v":2,"parentDoc":null,"childrenPages":[]}

patchPatch segment


Path Params

projKey:
required
string
The project key
envKey:
required
string
The environment key
key:
required
string
The segment key
Perform a partial update to a feature. The request body must be a valid [JSON Patch](https://tools.ietf.org/html/rfc6902) or [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) document. You can optionally submit a comment (which appears in the audit log, as well as webhook, Slack, and HipChat notifications) along with the partial update request. For more information on supported options, see the [Updates](doc:updates) section of our API documentation.

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) or [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) document. You can optionally submit a comment (which appears in the audit log, as well as webhook, Slack, and HipChat notifications) along with the partial update request. For more information on supported options, see the [Updates](doc:updates) section of our API documentation.
{"_id":"5aa813e9ebb96800bd78b915","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5aa80ac280914c00723eeed6","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-03-13T18:09:45.276Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"delete","examples":{"codes":[]},"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[{"_id":"5aa813e9ebb96800bd78b918","ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey"},{"_id":"5aa813e9ebb96800bd78b917","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"_id":"5aa813e9ebb96800bd78b916","ref":"","in":"path","required":true,"desc":"The segment key","default":"","type":"string","name":"key"}],"url":"/v2/segments/:projKey/:envKey/:key"},"isReference":false,"order":6,"body":"Delete an segment in a specified project and environment.","excerpt":"","slug":"delete-segment","type":"delete","title":"Delete segment","__v":3,"parentDoc":null,"childrenPages":[]}

deleteDelete segment


Path Params

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

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 }}

Result Format



Delete an segment in a specified project and environment.
{"_id":"571fb616d9baf12900c62a41","hidden":false,"link_external":false,"parentDoc":null,"slug":"users-overview","api":{"results":{"codes":[{"language":"json","status":200,"name":"","code":"{}"},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":"","auth":"required","params":[],"url":""},"category":"571fb615d9baf12900c62a1e","createdAt":"2015-05-27T20:31:24.004Z","order":0,"version":"571fb615d9baf12900c62a14","__v":0,"link_url":"","updates":[],"user":"5490ae350c7786160022fb4d","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.","isReference":true,"title":"Users overview","sync_unique":"","type":"basic","excerpt":"","githubsync":"","project":"5490cc10751f9d21005fb9c3","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.
{"_id":"57be70b6b55b7b0e00fd35f6","__v":3,"category":"571fb615d9baf12900c62a1e","isReference":true,"order":1,"sync_unique":"","user":"5490ae350c7786160022fb4d","body":"List all users in the environment. Includes the total count of users. In each page, there will be up to 'limit' users returned (default 20).  This is useful for exporting all users in the system for further analysis.  To paginate through, follow the 'next' link in the _links object, as [described above](https://apidocs.launchdarkly.com/docs/representations#collections).\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Note that the `next` link is only valid for 5 minutes. Even if the link itself doesn't change from one page to the next, the timeout will be reset on each page.\\n\\nAlso note that fetching the same page multiple times may return different results.\",\n  \"title\": \"Important note\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Deprecation note\",\n  \"body\": \"If you are using a prior version of this API including the 'lastId' parameter, those queries will still work, but you are encouraged to update your code to use only the links described above for better performance.\"\n}\n[/block]","excerpt":"","link_url":"","parentDoc":null,"type":"get","version":"571fb615d9baf12900c62a14","createdAt":"2016-08-25T04:14:46.589Z","hidden":false,"project":"5490cc10751f9d21005fb9c3","slug":"list-users","title":"List users","updates":[],"api":{"auth":"required","examples":{"codes":[]},"method":"get","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":"57be76523eb0e70e00d949b8","ref":"","in":"query","required":false,"desc":"The number of elements to return per page","default":"20","type":"string","name":"limit"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"_links\": {\n    \"next\": {\n      \"href\": \"/api/v2/users/default/production?h=af70b24e4f61214874fced4729cd24bb6487abea143ce05cc45c3e63560e3d11&scrollId=cXVlcnlUaGVuRmV0Y2g7MzsxMjY5MTYwOlJBUHJjajM5U09TRQdBZHzwVERSWHc7MTU5MDIyMzpsNDZCQVN4NlExV09QZWFyMjdQTkhnOzIwMjA0MTc6RGFYNy13Q1dUNENERVRsQ1ZrVmc0UTswOw%3D%3D\",\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"},"githubsync":"","link_external":false,"next":{"description":"","pages":[]},"childrenPages":[]}

getList users


Path Params

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

Query Params

limit:
string20
The number of elements to return per page
List all users in the environment. Includes the total count of users. In each page, there will be up to 'limit' users returned (default 20). This is useful for exporting all users in the system for further analysis. To paginate through, follow the 'next' link in the _links object, as [described above](https://apidocs.launchdarkly.com/docs/representations#collections). [block:callout] { "type": "info", "body": "Note that the `next` link is only valid for 5 minutes. Even if the link itself doesn't change from one page to the next, the timeout will be reset on each page.\n\nAlso note that fetching the same page multiple times may return different results.", "title": "Important note" } [/block] [block:callout] { "type": "warning", "title": "Deprecation note", "body": "If you are using a prior version of this API including the 'lastId' parameter, those queries will still work, but you are encouraged to update your code to use only the links described above for better performance." } [/block]

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. In each page, there will be up to 'limit' users returned (default 20). This is useful for exporting all users in the system for further analysis. To paginate through, follow the 'next' link in the _links object, as [described above](https://apidocs.launchdarkly.com/docs/representations#collections). [block:callout] { "type": "info", "body": "Note that the `next` link is only valid for 5 minutes. Even if the link itself doesn't change from one page to the next, the timeout will be reset on each page.\n\nAlso note that fetching the same page multiple times may return different results.", "title": "Important note" } [/block] [block:callout] { "type": "warning", "title": "Deprecation note", "body": "If you are using a prior version of this API including the 'lastId' parameter, those queries will still work, but you are encouraged to update your code to use only the links described above for better performance." } [/block]
{"_id":"571fb616d9baf12900c62a43","createdAt":"2015-05-27T20:32:36.608Z","editedParams":true,"editedParams2":true,"githubsync":"","link_url":"","order":2,"project":"5490cc10751f9d21005fb9c3","updates":[],"link_external":false,"parentDoc":null,"type":"get","api":{"url":"/users/:projKey/:envKey/:key","auth":"required","examples":{"codes":[]},"method":"get","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"},{"name":"key","_id":"55663cd5f579050d00c3d46d","ref":"","in":"path","required":true,"desc":"The user key","default":"","type":"string"}],"results":{"codes":[{"status":200,"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"}]},"settings":"57be249fddc0880e006f3b4a"},"excerpt":"","isReference":true,"slug":"get-user","title":"Get user","user":"5490ae350c7786160022fb4d","__v":1,"body":"Get a user by key. The `user` object will contain all attributes sent in `variation` calls for that key.","category":"571fb615d9baf12900c62a1e","hidden":false,"sync_unique":"","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.
{"_id":"571fb616d9baf12900c62a42","parentDoc":null,"type":"get","updates":[],"version":"571fb615d9baf12900c62a14","slug":"find-users","sync_unique":"","user":"5490ae350c7786160022fb4d","createdAt":"2015-05-27T20:32:06.563Z","excerpt":"","hidden":false,"isReference":true,"order":3,"title":"Find users","__v":2,"category":"571fb615d9baf12900c62a1e","editedParams":true,"link_external":false,"project":"5490cc10751f9d21005fb9c3","next":{"description":"","pages":[]},"api":{"url":"/user-search/:projKey/:envKey","auth":"required","examples":{"codes":[]},"method":"get","params":[{"type":"string","_id":"556630e0f579050d00c3d434","default":"","desc":"Full-text search for users based on name, first name, last name, e-mail address, or key","in":"query","name":"q","ref":"","required":false},{"required":false,"type":"int","_id":"556630e0f579050d00c3d433","default":"","desc":"Specifies the maximum number of items in the collection to return (max: 50, default: 20)","in":"query","name":"limit","ref":""},{"required":false,"desc":"Specifies the first item to return in the collection","default":"","type":"int","name":"offset","_id":"556630e0f579050d00c3d432","ref":"","in":"query"},{"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":"556630e0f579050d00c3d431"},{"default":"","type":"string","name":"projKey","_id":"57c0a057627a2a0e00c31867","ref":"","in":"path","required":true,"desc":"The project key"},{"in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey","_id":"57c0a057627a2a0e00c31866","ref":""}],"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"},"body":"Search users in LaunchDarkly based on their last active date, or a search query. It should not be used to enumerate all users in LaunchDarkly-- use the [List users](doc:list-users) API resource.","editedParams2":true,"githubsync":"","link_url":"","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 name, first name, last name, e-mail address, or key
limit:
integer
Specifies the maximum number of items in the collection to return (max: 50, default: 20)
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. 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. It should not be used to enumerate all users in LaunchDarkly-- use the [List users](doc:list-users) API resource.
{"_id":"58223df2c3b01d31008a1112","category":"571fb615d9baf12900c62a1e","createdAt":"2016-11-08T21:04:50.722Z","isReference":true,"next":{"pages":[],"description":""},"order":4,"project":"5490cc10751f9d21005fb9c3","user":"5490ae350c7786160022fb4d","__v":0,"excerpt":"","hidden":false,"link_external":false,"sync_unique":"","title":"Delete user","updates":[],"version":"571fb615d9baf12900c62a14","slug":"delete-user","type":"delete","link_url":"","body":"Delete a user by key.","githubsync":"","api":{"params":[{"type":"string","name":"projKey","_id":"58223df2c3b01d31008a1115","ref":"","in":"path","required":false,"desc":"The project Key","default":""},{"desc":"The environment key","default":"","type":"string","name":"envKey","_id":"58223df2c3b01d31008a1114","ref":"","in":"path","required":false},{"_id":"58223df2c3b01d31008a1113","ref":"","in":"path","required":false,"desc":"The user key","default":"","type":"string","name":"key"}],"results":{"codes":[{"status":204,"language":"json","code":"","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/users/:projKey/:envKey/:key","auth":"required","examples":{"codes":[]},"method":"delete"},"parentDoc":null,"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.
{"_id":"57c0a089115d800e00d4cc6e","api":{"params":[],"url":"","results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required"},"link_external":false,"order":0,"sync_unique":"","title":"User settings overview","type":"basic","__v":0,"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","isReference":true,"parentDoc":null,"slug":"user-settings-overview","createdAt":"2016-08-26T20:03:21.174Z","link_url":"","version":"571fb615d9baf12900c62a14","excerpt":"","githubsync":"","hidden":false,"project":"5490cc10751f9d21005fb9c3","updates":[],"user":"5490ae350c7786160022fb4d","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.
{"_id":"571fb615d9baf12900c62a37","api":{"params":[{"type":"string","name":"projKey","_id":"55edf4d451ee721700b31442","ref":"","in":"path","required":true,"desc":"The project key","default":""},{"desc":"The environment key","default":"","type":"string","name":"envKey","_id":"57c0a38fa3ba0b0e00eb11b2","ref":"","in":"path","required":true},{"name":"key","_id":"57c0a38fa3ba0b0e00eb11b1","ref":"","in":"path","required":true,"desc":"The user key","default":"","type":"string"}],"results":{"codes":[{"language":"json","status":200,"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}"},{"name":"","code":"{}","language":"json","status":400}]},"settings":"57be249fddc0880e006f3b4a","url":"/users/:projKey/:envKey/:key/flags","auth":"required","examples":{"codes":[]},"method":"get"},"createdAt":"2015-09-07T20:34:28.986Z","githubsync":"","slug":"flag-settings-for-user","version":"571fb615d9baf12900c62a14","editedParams2":true,"excerpt":"","isReference":true,"link_external":false,"parentDoc":null,"project":"5490cc10751f9d21005fb9c3","__v":1,"category":"57be0df1b9ef7c220047578f","editedParams":true,"updates":[],"user":"5490ae350c7786160022fb4d","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.","hidden":false,"link_url":"","order":1,"sync_unique":"","title":"List flag settings for user","type":"get","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.
{"_id":"571fb615d9baf12900c62a38","editedParams":true,"editedParams2":true,"link_external":false,"order":2,"project":"5490cc10751f9d21005fb9c3","slug":"get-flag-settings-for-user","version":"571fb615d9baf12900c62a14","__v":2,"api":{"method":"get","params":[{"desc":"The project key","default":"","type":"string","name":"projKey","_id":"57c0a7e7c3c39d0e003769f3","ref":"","in":"path","required":true},{"_id":"57c0a7e7c3c39d0e003769f2","ref":"","in":"path","required":true,"desc":"The environment key","default":"","type":"string","name":"envKey"},{"name":"key","_id":"55edf5777145f717001ac144","ref":"","in":"path","required":true,"desc":"The user key","default":"","type":"string"},{"type":"string","name":"featureKey","_id":"55edf5777145f717001ac143","ref":"","in":"path","required":true,"desc":"The feature key","default":""}],"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},{"code":"{}","language":"json","status":400,"name":""}]},"settings":"57be249fddc0880e006f3b4a","url":"/users/:projKey/:envKey/:key/flags/:featureKey","auth":"required","examples":{"codes":[]}},"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","link_url":"","next":{"description":"","pages":[]},"sync_unique":"","excerpt":"","githubsync":"","hidden":false,"isReference":true,"title":"Get flag setting for user","type":"get","updates":[],"user":"5490ae350c7786160022fb4d","createdAt":"2015-09-07T20:37:11.520Z","parentDoc":null,"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.
{"_id":"571fb615d9baf12900c62a39","hidden":false,"link_url":"","parentDoc":null,"updates":["56e9fb015ea49c0e0055e93d","57d026166b4de029009583c1"],"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.","createdAt":"2015-09-07T20:40:56.958Z","editedParams":true,"version":"571fb615d9baf12900c62a14","order":3,"sync_unique":"","__v":4,"editedParams2":true,"isReference":true,"link_external":false,"title":"Update flag setting for user","type":"put","category":"57be0df1b9ef7c220047578f","excerpt":"","githubsync":"","project":"5490cc10751f9d21005fb9c3","api":{"params":[{"ref":"","in":"path","required":true,"desc":"The project key","default":"","type":"string","name":"projKey","_id":"57c0a82b6df4490e00834108"},{"default":"","type":"string","name":"envKey","_id":"57c0a82b6df4490e00834107","ref":"","in":"path","required":true,"desc":"The environment key"},{"in":"path","required":false,"desc":"The user key","default":"","type":"string","name":"key","_id":"55edf658993c171700a2c093","ref":""},{"desc":"The feature key","default":"","type":"string","name":"featureKey","_id":"55edf658993c171700a2c092","ref":"","in":"path","required":false},{"_id":"57c4ccee76062f0e001b369e","default":"","desc":"The variation value to set for the user","in":"body","name":"setting","ref":"","required":false,"type":"boolean"}],"results":{"codes":[{"code":"{}","language":"json","status":204,"name":""},{"language":"json","status":400,"name":"","code":"{}"}]},"settings":"57be2876ddc0880e006f3b4d","url":"/users/:projKey/:envKey/:key/flags/:featureKey","auth":"required","examples":{"codes":[]},"method":"put"},"next":{"description":"","pages":[]},"slug":"update-flag-setting-for-user","user":"5490ae350c7786160022fb4d","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.
{"_id":"571fb615d9baf12900c62a31","slug":"audit-log-overview","category":"571fb615d9baf12900c62a18","createdAt":"2016-02-08T22:00:46.350Z","hidden":false,"link_external":false,"link_url":"","order":0,"project":"5490cc10751f9d21005fb9c3","sync_unique":"","__v":0,"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.","isReference":true,"parentDoc":null,"updates":[],"version":"571fb615d9baf12900c62a14","api":{"settings":"","auth":"required","params":[],"url":"","results":{"codes":[{"status":200,"name":"","code":"{}","language":"json"},{"code":"{}","language":"json","status":400,"name":""}]}},"excerpt":"","user":"5490ae350c7786160022fb4d","githubsync":"","title":"Audit log overview","type":"basic","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.
{"_id":"571fb615d9baf12900c62a32","slug":"list-audit-log-entries","title":"List audit log feature flag entries","api":{"params":[{"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":"56b90f08578edc0d0023cf7c"},{"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":"56b90f08578edc0d0023cf7b","ref":""},{"desc":"A text search query","default":"","type":"string","name":"q","_id":"56b90f08578edc0d0023cf7a","ref":"","in":"query","required":false},{"name":"limit","_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"},{"ref":"","in":"query","required":false,"desc":"A resource specifier, allowing you to filter audit log listings by resource","default":"","type":"string","name":"spec","_id":"57c0a9cbc3c39d0e003769f7"}],"results":{"codes":[{"language":"json","status":200,"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}"},{"status":400,"name":"","code":"{\nmessage: \"'before' must be a valid epoch time in milliseconds\"\n}","language":"json"}]},"settings":"57be249fddc0880e006f3b4a","url":"/auditlog","auth":"required","examples":{"codes":[]},"method":"get"},"createdAt":"2016-02-08T21:57:18.947Z","link_external":false,"parentDoc":null,"sync_unique":"","updates":[],"version":"571fb615d9baf12900c62a14","editedParams":true,"hidden":false,"project":"5490cc10751f9d21005fb9c3","excerpt":"","githubsync":"","link_url":"","order":1,"__v":1,"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","editedParams2":true,"type":"get","user":"5490ae350c7786160022fb4d","isReference":true,"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.
{"_id":"571fb615d9baf12900c62a33","__v":0,"api":{"url":"/auditlog/:id","auth":"required","examples":{"codes":[]},"method":"get","params":[{"_id":"56b91fd9ddeb231700e698f4","ref":"","required":false,"desc":"The ID of the audit log entry","default":"","type":"string","name":"id","in":"path"}],"results":{"codes":[{"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,"name":""}]},"settings":"57be249fddc0880e006f3b4a"},"editedParams2":true,"githubsync":"","isReference":true,"updates":[],"version":"571fb615d9baf12900c62a14","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","createdAt":"2016-02-08T23:08:09.012Z","parentDoc":null,"slug":"get-audit-log-entry","title":"Get audit log entry","editedParams":true,"excerpt":"","order":2,"sync_unique":"","type":"get","category":"571fb615d9baf12900c62a18","hidden":false,"link_external":false,"link_url":"","project":"5490cc10751f9d21005fb9c3","user":"5490ae350c7786160022fb4d","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
{"_id":"571fb616d9baf12900c62a49","category":"571fb615d9baf12900c62a19","link_url":"","parentDoc":null,"title":"Webhooks overview","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:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Webhook delivery order\",\n  \"body\": \"Note that webhooks may not be delivered in chronological order. We recommend using the payload's \\\"date\\\" field as a timestamp to reorder webhooks as they are received.\"\n}\n[/block]\n\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.","excerpt":"","githubsync":"","link_external":false,"project":"5490cc10751f9d21005fb9c3","type":"basic","updates":[],"__v":1,"user":"5490ae350c7786160022fb4d","order":0,"isReference":true,"createdAt":"2016-03-04T21:30:23.618Z","hidden":false,"slug":"webhooks-overview","sync_unique":"","version":"571fb615d9baf12900c62a14","api":{"url":"","results":{"codes":[{"name":"","code":"{}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","auth":"required","params":[]},"next":{"description":"","pages":[]},"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:callout] { "type": "info", "title": "Webhook delivery order", "body": "Note that webhooks may not be delivered in chronological order. We recommend using the payload's \"date\" field as a timestamp to reorder webhooks as they are received." } [/block] [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:callout] { "type": "info", "title": "Webhook delivery order", "body": "Note that webhooks may not be delivered in chronological order. We recommend using the payload's \"date\" field as a timestamp to reorder webhooks as they are received." } [/block] [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.
{"_id":"571fb616d9baf12900c62a4a","slug":"list-webhooks","sync_unique":"","__v":1,"body":"Fetch a list of all webhooks.","category":"571fb615d9baf12900c62a19","createdAt":"2016-03-04T21:31:19.332Z","link_external":false,"version":"571fb615d9baf12900c62a14","githubsync":"","order":1,"updates":[],"link_url":"","project":"5490cc10751f9d21005fb9c3","user":"5490ae350c7786160022fb4d","type":"get","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[],"results":{"codes":[{"language":"json","status":200,"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  \t\t\"name\": \"Example Hook\",\n      \"url\": \"http://requestb.in/wl7i6twl\",\n      \"secret\": \"3c857a8da2f349edb015b311eca2d3d1\",\n      \"on\": false,\n      \"tags\": []\n    }\n  ]\n}"}]},"settings":"57be249fddc0880e006f3b4a","url":"/webhooks"},"excerpt":"","hidden":false,"isReference":true,"parentDoc":null,"title":"List webhooks","next":{"description":"","pages":[]},"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.
{"_id":"571fb616d9baf12900c62a4b","body":"Get a single webhook by ID.","editedParams":true,"updates":[],"version":"571fb615d9baf12900c62a14","title":"Get webhook","type":"get","user":"5490ae350c7786160022fb4d","__v":2,"excerpt":"","isReference":true,"project":"5490cc10751f9d21005fb9c3","slug":"get-webhook","githubsync":"","hidden":false,"link_external":false,"order":2,"parentDoc":null,"sync_unique":"","api":{"auth":"required","examples":{"codes":[]},"method":"get","params":[{"_id":"56da03d42716531d00b1a5e2","ref":"","in":"path","required":false,"desc":"The ID of the webhook","default":"","type":"string","name":"id"}],"results":{"codes":[{"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  \"name\": \"Example Hook\",\n  \"url\": \"http://requestb.in/wl7i6twl\",\n  \"secret\": \"3c857a8da2f349edb015b311eca2d3d1\",\n  \"on\": false,\n  \"tags\": []\n}","name":"","status":200,"language":"json"}]},"settings":"57be249fddc0880e006f3b4a","url":"/webhooks/:id"},"category":"571fb615d9baf12900c62a19","createdAt":"2016-03-04T21:30:49.235Z","editedParams2":true,"link_url":"","next":{"description":"","pages":[]},"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.
{"_id":"5a67b1258157bf003eb261d4","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"571fb615d9baf12900c62a19","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-23T22:03:17.176Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"javascript","code":"{\n  \"url\": \"http://www.example.com\",\n  \"secret\": \"frobozz\",\n  \"sign\": true,\n  \"on\": true,\n  \"name\": \"Example Hook\"\n}"}]},"method":"post","results":{"codes":[{"name":"","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  \"name\": \"Example Hook\",\n  \"url\": \"http://www.example.com\",\n  \"secret\": \"frobozz\",\n  \"on\": true,\n  \"tags\": []\n}"},{"language":"json","code":"{}","name":"","status":400}]},"settings":"57be2876ddc0880e006f3b4d","auth":"required","params":[{"_id":"5a67b1e073eb28003485e722","ref":"","in":"body","required":true,"desc":"The URL of the remote webhook","default":"","type":"string","name":"url"},{"_id":"5a67b1e073eb28003485e721","ref":"","in":"body","required":false,"desc":"If sign is true, and the secret attribute is omitted, LaunchDarkly will automatically generate a secret for you.","default":"","type":"string","name":"secret"},{"_id":"5a67b23020cda6001e8f2b61","ref":"","in":"body","required":true,"desc":"If sign is false, the webhook will not include a signature header, and the secret can be omitted.","default":"","type":"boolean","name":"sign"},{"_id":"5a67b23020cda6001e8f2b60","ref":"","in":"body","required":true,"desc":"Whether this webhook is enabled or not.","default":"","type":"boolean","name":"on"},{"_id":"5aa8097fcadf500091c275f2","ref":"","in":"body","required":false,"desc":"A human-readable name for your webhook","default":"","type":"string","name":"name"}],"url":"/webhooks"},"isReference":true,"order":3,"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.","excerpt":"","slug":"create-webhook-2-1","type":"post","title":"Create webhook","__v":7,"parentDoc":null,"childrenPages":[]}

postCreate webhook


Body Params

url:
required
string
The URL of the remote webhook
secret:
string
If sign is true, and the secret attribute is omitted, LaunchDarkly will automatically generate a secret for you.
sign:
required
boolean
If sign is false, the webhook will not include a signature header, and the secret can be omitted.
on:
required
boolean
Whether this webhook is enabled or not.
name:
string
A human-readable name for your 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.
{"_id":"571fb616d9baf12900c62a4d","createdAt":"2016-03-04T21:31:38.763Z","user":"5490ae350c7786160022fb4d","updates":[],"category":"571fb615d9baf12900c62a19","excerpt":"","githubsync":"","link_url":"","parentDoc":null,"project":"5490cc10751f9d21005fb9c3","title":"Update webhook","api":{"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  \"name\": \"Example Hook\",\n  \"url\": \"http://www.example.com\",\n  \"secret\": \"frobozz\",\n  \"on\": true,\n  \"tags\": []\n}","language":"json","status":200},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":"57be24d969196d0e00d0b5de","url":"/webhooks/:id","auth":"required","examples":{"codes":[{"code":"[\n  {\n    \"op\": \"replace\",\n    \"path\": \"/on\",\n    \"value\": true\n  }\n]","language":"json"}]},"method":"patch"},"hidden":false,"link_external":false,"order":4,"sync_unique":"","type":"patch","version":"571fb615d9baf12900c62a14","__v":2,"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.","isReference":true,"slug":"update-webhook","next":{"description":"","pages":[]},"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.
{"_id":"571fb616d9baf12900c62a4e","createdAt":"2016-03-04T21:56:04.167Z","editedParams":true,"link_url":"","sync_unique":"","title":"Delete webhook","category":"571fb615d9baf12900c62a19","githubsync":"","hidden":false,"order":5,"slug":"delete-webhook","updates":[],"editedParams2":true,"isReference":true,"link_external":false,"parentDoc":null,"user":"5490ae350c7786160022fb4d","version":"571fb615d9baf12900c62a14","__v":0,"api":{"results":{"codes":[{"name":"","code":"","language":"json","status":204}]},"settings":"57be249fddc0880e006f3b4a","url":"/webhooks/:id","auth":"required","examples":{"codes":[]},"method":"delete","params":[{"required":false,"desc":"The ID of the webhook to delete","default":"","type":"string","name":"id","in":"path","_id":"56da04747222d50b00701668","ref":""}]},"body":"Delete a webhook by ID.","excerpt":"","project":"5490cc10751f9d21005fb9c3","type":"delete","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.
{"_id":"5a5686063f58350012e0d27e","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5a53bbd0dc3db80012c1e3f8","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-10T21:30:46.617Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Available to enterprise customers\",\n  \"body\": \"Custom roles are available to customers on our enterprise plans. If you're interested in learning more about our enterprise plans, contact sales@launchdarkly.com .\"\n}\n[/block]\nCustom roles allow you to create flexible policies providing fine-grained access control to everything in LaunchDarkly-- from feature flags to goals, environments and teams. With custom roles, it's possible to enforce access policies that meet your exact workflow needs. \n\nThe custom roles API allows you to create, update and delete custom roles. You can also use the API to list all of your custom roles or get a custom role by ID.\n\nFor more information about custom roles and the syntax for custom role policies, see the product documentation for  [Custom roles](https://docs.launchdarkly.com/docs/custom-roles).","excerpt":"","slug":"custom-roles-overview","type":"basic","title":"Custom roles overview","__v":0,"parentDoc":null,"childrenPages":[]}

Custom roles overview


[block:callout] { "type": "info", "title": "Available to enterprise customers", "body": "Custom roles are available to customers on our enterprise plans. If you're interested in learning more about our enterprise plans, contact sales@launchdarkly.com ." } [/block] Custom roles allow you to create flexible policies providing fine-grained access control to everything in LaunchDarkly-- from feature flags to goals, environments and teams. With custom roles, it's possible to enforce access policies that meet your exact workflow needs. The custom roles API allows you to create, update and delete custom roles. You can also use the API to list all of your custom roles or get a custom role by ID. For more information about custom roles and the syntax for custom role policies, see the product documentation for [Custom roles](https://docs.launchdarkly.com/docs/custom-roles).
[block:callout] { "type": "info", "title": "Available to enterprise customers", "body": "Custom roles are available to customers on our enterprise plans. If you're interested in learning more about our enterprise plans, contact sales@launchdarkly.com ." } [/block] Custom roles allow you to create flexible policies providing fine-grained access control to everything in LaunchDarkly-- from feature flags to goals, environments and teams. With custom roles, it's possible to enforce access policies that meet your exact workflow needs. The custom roles API allows you to create, update and delete custom roles. You can also use the API to list all of your custom roles or get a custom role by ID. For more information about custom roles and the syntax for custom role policies, see the product documentation for [Custom roles](https://docs.launchdarkly.com/docs/custom-roles).
{"_id":"5a53bbde8ec7e600123ab942","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5a53bbd0dc3db80012c1e3f8","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-08T18:43:42.293Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"_links\": {\n        \"self\": {\n            \"href\": \"/api/v2/roles\",\n            \"type\": \"application/json\"\n        }\n    },\n    \"items\": [\n        {\n            \"_links\": {\n                \"parent\": {\n                    \"href\": \"/api/v2/roles\",\n                    \"type\": \"application/json\"\n                },\n                \"self\": {\n                    \"href\": \"/api/v2/roles/example-role\",\n                    \"type\": \"application/json\"\n                }\n            },\n            \"name\": \"example role\",\n            \"key\": \"example-role\",\n            \"description\": \"Deny access to production environments\",\n            \"_id\": \"5a593f890z875421af55d96e\",\n            \"policy\": [\n                {\n                    \"resources\": [\n                        \"proj/*:env/production\"\n                    ],\n                    \"actions\": [\n                        \"*\"\n                    ],\n                    \"effect\": \"deny\"\n                }\n            ]\n        }\n    ]\n}","name":""}]},"settings":"57be249fddc0880e006f3b4a","auth":"required","params":[],"url":"/roles","examples":{"codes":[]},"method":"get"},"isReference":false,"order":1,"body":"Return a complete list of custom roles.","excerpt":"","slug":"list-custom-roles","type":"get","title":"List custom roles","__v":0,"parentDoc":null,"childrenPages":[]}

getList custom roles


Return a complete list of custom roles.

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



Return a complete list of custom roles.
{"_id":"5a54040ae88a63001c02ccce","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5a53bbd0dc3db80012c1e3f8","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-08T23:51:38.766Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"get","examples":{"codes":[]},"settings":"57be249fddc0880e006f3b4a","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"_links\": {\n        \"parent\": {\n            \"href\": \"/api/v2/roles\",\n            \"type\": \"application/json\"\n        },\n        \"self\": {\n            \"href\": \"/api/v2/roles/example-role\",\n            \"type\": \"application/json\"\n        }\n    },\n    \"name\": \"example role\",\n    \"key\": \"example-role\",\n    \"description\": \"sets a good example\",\n    \"_id\": \"5a554j890b575421b255d96e\",\n    \"policy\": [\n        {\n            \"resources\": [\n                \"proj/*:env/test\"\n            ],\n            \"actions\": [\n                \"*\"\n            ],\n            \"effect\": \"deny\"\n        }\n    ]\n}","name":""}]},"auth":"required","params":[{"_id":"5a5405176b985a0034ea8330","ref":"","in":"path","required":false,"desc":"The role's key","default":"","type":"string","name":"key"}],"url":"/roles/:key"},"isReference":false,"order":2,"body":"Get a single role by key.","excerpt":"","slug":"get-custom-role","type":"get","title":"Get custom role","__v":6,"parentDoc":null,"childrenPages":[]}

getGet custom role


Path Params

key:
string
The role's key
Get a single role 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



Get a single role by key.
{"_id":"5a54004f669304003210418d","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5a53bbd0dc3db80012c1e3f8","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-08T23:35:43.756Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"json","code":"{\n  \"name\": \"test role\",\n  \"key\": \"test-role\",\n  \"description\": \"test role is described here\",\n  \"policy\": [{\n    \"resources\": [\"proj/*:env/production\"],\n    \"actions\": [\"*\"],\n    \"effect\": \"allow\"\n  }]\n}\n"}]},"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"_links\": {\n        \"parent\": {\n            \"href\": \"/api/v2/roles\",\n            \"type\": \"application/json\"\n        },\n        \"self\": {\n            \"href\": \"/api/v2/roles/test-role\",\n            \"type\": \"application/json\"\n        }\n    },\n    \"name\": \"test role\",\n    \"key\": \"test-role\",\n    \"description\": \"Allow access to production\",\n    \"_id\": \"5a580a01b4ff89217bdf9dc1\",\n    \"policy\": [{\n        \"resources\": [\"proj/*:env/production\"],\n        \"actions\": [\"*\"],\n        \"effect\": \"allow\"\n    }],\n    \"_access\": {\n        \"denied\": []\n    }\n}","name":""}]},"settings":"57be2876ddc0880e006f3b4d","auth":"required","params":[{"_id":"5a5550276ecf14003270ab85","ref":"","in":"body","required":true,"desc":"a name for the custom role","default":"","type":"string","name":"name"},{"_id":"5a5550276ecf14003270ab84","ref":"","in":"body","required":true,"desc":"a unique key that will be used to reference the custom role in your code","default":"","type":"string","name":"key"},{"_id":"5a5550276ecf14003270ab83","ref":"","in":"body","required":false,"desc":"description of the custom role","default":"","type":"string","name":"description"},{"_id":"5a5550276ecf14003270ab82","ref":"","in":"body","required":true,"desc":"a JSON array of statements represented as JSON objects with 3 attributes: effect, resources, actions","default":"","type":"array_object","name":"policy"}],"url":"/roles","method":"post"},"isReference":false,"order":3,"body":"Creates a new custom role.","excerpt":"","slug":"create-custom-role","type":"post","title":"Create custom role","__v":9,"parentDoc":null,"childrenPages":[]}

postCreate custom role


Body Params

name:
required
string
a name for the custom role
key:
required
string
a unique key that will be used to reference the custom role in your code
description:
string
description of the custom role
policy:
required
array of objects
a JSON array of statements represented as JSON objects with 3 attributes: effect, resources, actions
Creates a new custom role.

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 custom role.
{"_id":"5a5405444817aa001e5f7fbf","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5a53bbd0dc3db80012c1e3f8","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-08T23:56:52.488Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"patch","settings":"57be24d969196d0e00d0b5de","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"_links\": {\n        \"parent\": {\n            \"href\": \"/api/v2/roles\",\n            \"type\": \"application/json\"\n        },\n        \"self\": {\n            \"href\": \"/api/v2/roles/role-role\",\n            \"type\": \"application/json\"\n        }\n    },\n    \"name\": \"sample role\",\n    \"key\": \"sample-role\",\n    \"description\": \"stuff\",\n    \"_id\": \"5a5806c35bdd0d2171353753\",\n    \"policy\": [\n        {\n            \"resources\": [\n                \"proj/*:env/production\"\n            ],\n            \"actions\": [\n                \"*\"\n            ],\n            \"effect\": \"allow\"\n        }\n    ],\n    \"_access\": {\n        \"denied\": []\n    }\n}","name":""}]},"examples":{"codes":[{"code":"  [\n    {\n      \"op\": \"replace\",\n      \"path\": \"/policy/0/effect\",\n      \"value\": \"allow\"\n    }\n  ]","language":"json"}]},"auth":"required","params":[{"_id":"5a54064fe88a63001c02ccd8","ref":"","in":"path","required":false,"desc":"The key of the custom role to update","default":"","type":"string","name":"key"}],"url":"/roles/:key"},"isReference":false,"order":4,"body":"Update a single custom role. The request should be a valid [JSON Patch document](https://tools.ietf.org/html/rfc6902) describing the changes to be made to the custom role.","excerpt":"","slug":"update-custom-role","type":"patch","title":"Update custom role","__v":7,"parentDoc":null,"childrenPages":[]}

patchUpdate custom role


Path Params

key:
string
The key of the custom role to update
Update a single custom role. The request should be a valid [JSON Patch document](https://tools.ietf.org/html/rfc6902) describing the changes to be made to the custom role.

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 single custom role. The request should be a valid [JSON Patch document](https://tools.ietf.org/html/rfc6902) describing the changes to be made to the custom role.
{"_id":"5a5407054817aa001e5f7fc7","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"5a53bbd0dc3db80012c1e3f8","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-09T00:04:21.714Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[{"status":204,"language":"json","code":""}]},"settings":"57be249fddc0880e006f3b4a","method":"delete","auth":"required","params":[{"_id":"5a54064fe88a63001c02ccd8","ref":"","in":"path","required":false,"desc":"The key of the custom role to delete","default":"","type":"string","name":"key"}],"url":"/roles/:key"},"isReference":false,"order":5,"body":"Delete a custom role by ID.","excerpt":"","slug":"delete-custom-role","type":"delete","title":"Delete custom role","__v":3,"parentDoc":null,"childrenPages":[]}

deleteDelete custom role


Path Params

key:
string
The key of the custom role to delete
Delete a custom role 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 custom role by ID.
{"_id":"59a065f5b89345003712305f","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"59932b00b58e04000f14abd0","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-08-25T18:01:25.125Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"The Team Members API allows you to invite new members to a team by making a POST request to /api/v2/members.  When you invite a new member to a team, an invitation will be sent to the email you have provided.  Members with \"admin\" or \"owner\" roles may create new members, as well as anyone with a \"createMember\" permission for \"member/*\".\n\nAny member may request the complete list of team members with a GET to /api/v2/members.","excerpt":"","slug":"team-members-overview","type":"basic","title":"Team members overview","__v":0,"parentDoc":null,"childrenPages":[]}

Team members overview


The Team Members API allows you to invite new members to a team by making a POST request to /api/v2/members. When you invite a new member to a team, an invitation will be sent to the email you have provided. Members with "admin" or "owner" roles may create new members, as well as anyone with a "createMember" permission for "member/*". Any member may request the complete list of team members with a GET to /api/v2/members.
The Team Members API allows you to invite new members to a team by making a POST request to /api/v2/members. When you invite a new member to a team, an invitation will be sent to the email you have provided. Members with "admin" or "owner" roles may create new members, as well as anyone with a "createMember" permission for "member/*". Any member may request the complete list of team members with a GET to /api/v2/members.
{"_id":"59932ec9ef8695000fbc7317","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"59932b00b58e04000f14abd0","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-08-15T17:26:33.380Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"57be249fddc0880e006f3b4a","results":{"codes":[{"status":200,"name":"","code":"{\n  \"items\": [\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/members\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"_id\": \"599335395c0a211d59c7ae30\",\n      \"firstName\": \"Member\",\n      \"lastName\": \"One\",\n      \"role\": \"admin\",\n      \"email\": \"Member.NumeroUno@example.com\",\n      \"_pendingInvite\": true,\n      \"isBeta\": false,\n      \"customRoles\": [],\n      \"mfa\": \"disabled\",\n      \"_access\": null\n    },\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/members\",\n          \"type\": \"application/json\"\n        },\n      },\n      \"_id\": \"599335395c0a211d59c7ae31\",\n      \"firstName\": \"Member\",\n      \"lastName\": \"Two\",\n      \"role\": \"reader\",\n      \"email\": \"Member.TheSecond@example.com\",\n      \"_pendingInvite\": true,\n      \"isBeta\": false,\n      \"customRoles\": [\"ab412d4\", \"a4fe934\"],\n      \"mfa\": \"disabled\",\n      \"_access\": null\n    }\n  ]\n  \"_links\": {\n\t  \"self\": {\n\t  \"href\": \"/api/v2/members\",\n\t  \"type\": \"application/json\"\n\t}\n}","language":"json"}]},"method":"get","examples":{"codes":[{"language":"json","code":""}]},"auth":"required","params":[],"url":"/members"},"isReference":false,"order":1,"body":"Return a complete list of team members.","excerpt":"","slug":"list-team-members","type":"get","title":"List team members","__v":0,"parentDoc":null,"childrenPages":[]}

getList team members


Return a complete list of team members.

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



Return a complete list of team members.
{"_id":"5a53e2db115769001e8d6cf8","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"59932b00b58e04000f14abd0","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-08T21:30:03.719Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"_links\": {\n    \"parent\": {\n      \"href\": \"/api/v2/members\",\n      \"type\": \"application/json\"\n    },\n    \"self\": {\n      \"href\": \"/api/v2/members/5a3ad672761af020881a8814\",\n      \"type\": \"application/json\"\n    },\n    \"sendMfaEnableRequest\": {\n      \"href\": \"/api/v2/members/5a3ad672761af020881a8814/mfa/request\",\n      \"type\": \"application/json\"\n    }\n  },\n    \"_id\": \"5a3ad672761af020881a8814\",\n    \"role\": \"owner\",\n    \"email\": \"owner-sample-account@launchdarkly.com\",\n    \"_pendingInvite\": false,\n    \"isBeta\": false,\n    \"customRoles\": [],\n    \"mfa\": \"disabled\",\n    \"_access\": {\n      \"denied\": []\n  }\n}","name":""}]},"settings":"57be249fddc0880e006f3b4a","auth":"required","params":[{"_id":"5a53e49a6693040032103ecd","ref":"","in":"path","required":false,"desc":"The ID of the member","default":"","type":"string","name":"id"}],"url":"/members/:id","method":"get"},"isReference":false,"order":2,"body":"Get a single team member by ID.","excerpt":"","slug":"get-team-member","type":"get","title":"Get team member","__v":5,"parentDoc":null,"childrenPages":[]}

getGet team member


Path Params

id:
string
The ID of the member
Get a single team member 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 team member by ID.
{"_id":"59932e90b58e04000f14ac20","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"59932b00b58e04000f14abd0","user":"5490ae350c7786160022fb4d","updates":["5a53c6211c2fce001c6610d4"],"next":{"pages":[],"description":""},"createdAt":"2017-08-15T17:25:36.426Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"json","code":"[\n  {\n    \"email\": \"Member.NumeroUno@example.com\",\n    \"firstName\": \"Member\",\n    \"lastName\": \"One\",\n    \"role\": \"admin\"\n  },\n  {\n    \"email\": \"Member.TheSecond@example.com\",\n    \"firstName\": \"Member\",\n    \"lastName\": \"Two\",\n    \"customRoles\": [\"team-one\", \"team-two\"]\n  }\n]"}]},"method":"post","results":{"codes":[{"language":"json","code":"{\n  \"items\": [\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/members\",\n          \"type\": \"application/json\"\n        }\n      },\n      \"_id\": \"599335395c0a211d59c7ae30\",\n      \"firstName\": \"Member\",\n      \"lastName\": \"One\",\n      \"role\": \"admin\",\n      \"email\": \"Member.NumeroUno@example.com\",\n      \"_pendingInvite\": true,\n      \"isBeta\": false,\n      \"customRoles\": [],\n      \"mfa\": \"disabled\",\n      \"_access\": null\n    },\n    {\n      \"_links\": {\n        \"parent\": {\n          \"href\": \"/api/v2/members\",\n          \"type\": \"application/json\"\n        },\n      },\n      \"_id\": \"599335395c0a211d59c7ae31\",\n      \"firstName\": \"Member\",\n      \"lastName\": \"Two\",\n      \"role\": \"reader\",\n      \"email\": \"Member.TheSecond@example.com\",\n      \"_pendingInvite\": true,\n      \"isBeta\": false,\n      \"customRoles\": [\"b5ae356\", \"c7f2b56\"],\n      \"mfa\": \"disabled\",\n      \"_access\": null\n    }\n  ]\n}","name":"","status":201},{"status":400,"language":"json","code":"{\n  \"message\": \"Members with the following e-mail addresses already exist in this account: user@example.com\",\n  \"code\": \"email_already_exists_in_account\",\n  \"invalid_emails\": [\"user@example.com\"]\n}"}]},"settings":"57be24d969196d0e00d0b5de","auth":"required","params":[],"url":"/members"},"isReference":false,"order":3,"body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Full use of this API resource is only available to teams with paid subscriptions.\",\n  \"body\": \"The ability to bulk invite members is a paid feature. Single members may be invited if not on a paid plan.\"\n}\n[/block]\nInvite one or more new team members to join an account.  Each member will each be sent an invitation.  Members with \"admin\" or \"owner\" roles may create new members, as well as anyone with a \"createMember\" permission for \"member/*\".  If for some reason, a member cannot be invited, the entire request will be rejected and no members will be invited for that request.\n\nTo invite members to the account, send a `POST` request to this URL with a request body containing a JSON encoded list of new members.  The data should be a list of new member objects that looks like:\n\n```\n[{\n  \"email\": \"myname@example.com\", (required)\n  \"firstName\": \"Sam\", (optional)\n  \"lastName\": \"Smith\", (optional)\n  \"role\": <\"reader\", \"writer\", \"admin\" or \"owner\"> (optional)\n  \"customRoles\": [<ids or keys of custom roles>] (optional)\n},\n...]\n```\n\nEach member *must* have an `email` field and either a `role` or a `customRoles` field. If any of the fields are not populated correctly, the request is rejected with the reason specified in the \"message\" field of the response.\n\n*No more than 50 members may be created per request.*\n\nIn addition, to having an invalid payload or too many members, a request may fail because of conflicts with existing members.  These conflicts are reported using the additional `code` and `invalid_emails` response fields with the following possible values for `code`: \n\n* **email_already_exists_in_account**: A member with this email address already exists in this account.\n* **email_taken_in_different_account**: A member with this email address exists in another account. \n* **duplicate_emails**: This request contains two or more members with the same email address.\n\nA request that fails for one of the above reasons will return an HTTP response code of 400 (Bad Request).","excerpt":"","slug":"create-team-members-1","type":"post","title":"Create team members","__v":1,"parentDoc":null,"childrenPages":[]}

postCreate team members


[block:callout] { "type": "danger", "title": "Full use of this API resource is only available to teams with paid subscriptions.", "body": "The ability to bulk invite members is a paid feature. Single members may be invited if not on a paid plan." } [/block] Invite one or more new team members to join an account. Each member will each be sent an invitation. Members with "admin" or "owner" roles may create new members, as well as anyone with a "createMember" permission for "member/*". If for some reason, a member cannot be invited, the entire request will be rejected and no members will be invited for that request. To invite members to the account, send a `POST` request to this URL with a request body containing a JSON encoded list of new members. The data should be a list of new member objects that looks like: ``` [{ "email": "myname@example.com", (required) "firstName": "Sam", (optional) "lastName": "Smith", (optional) "role": <"reader", "writer", "admin" or "owner"> (optional) "customRoles": [<ids or keys of custom roles>] (optional) }, ...] ``` Each member *must* have an `email` field and either a `role` or a `customRoles` field. If any of the fields are not populated correctly, the request is rejected with the reason specified in the "message" field of the response. *No more than 50 members may be created per request.* In addition, to having an invalid payload or too many members, a request may fail because of conflicts with existing members. These conflicts are reported using the additional `code` and `invalid_emails` response fields with the following possible values for `code`: * **email_already_exists_in_account**: A member with this email address already exists in this account. * **email_taken_in_different_account**: A member with this email address exists in another account. * **duplicate_emails**: This request contains two or more members with the same email address. A request that fails for one of the above reasons will return an HTTP response code of 400 (Bad Request).

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



[block:callout] { "type": "danger", "title": "Full use of this API resource is only available to teams with paid subscriptions.", "body": "The ability to bulk invite members is a paid feature. Single members may be invited if not on a paid plan." } [/block] Invite one or more new team members to join an account. Each member will each be sent an invitation. Members with "admin" or "owner" roles may create new members, as well as anyone with a "createMember" permission for "member/*". If for some reason, a member cannot be invited, the entire request will be rejected and no members will be invited for that request. To invite members to the account, send a `POST` request to this URL with a request body containing a JSON encoded list of new members. The data should be a list of new member objects that looks like: ``` [{ "email": "myname@example.com", (required) "firstName": "Sam", (optional) "lastName": "Smith", (optional) "role": <"reader", "writer", "admin" or "owner"> (optional) "customRoles": [<ids or keys of custom roles>] (optional) }, ...] ``` Each member *must* have an `email` field and either a `role` or a `customRoles` field. If any of the fields are not populated correctly, the request is rejected with the reason specified in the "message" field of the response. *No more than 50 members may be created per request.* In addition, to having an invalid payload or too many members, a request may fail because of conflicts with existing members. These conflicts are reported using the additional `code` and `invalid_emails` response fields with the following possible values for `code`: * **email_already_exists_in_account**: A member with this email address already exists in this account. * **email_taken_in_different_account**: A member with this email address exists in another account. * **duplicate_emails**: This request contains two or more members with the same email address. A request that fails for one of the above reasons will return an HTTP response code of 400 (Bad Request).
{"_id":"5a53e56442190400124243e7","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"59932b00b58e04000f14abd0","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-08T21:40:52.390Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"patch","settings":"57be24d969196d0e00d0b5de","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"_links\": {\n        \"parent\": {\n            \"href\": \"/api/v2/members\",\n            \"type\": \"application/json\"\n        },\n        \"resendInvitation\": {\n            \"href\": \"/api/v2/members/5a57b98e659e4121a07aa841/resend-invitation\",\n            \"type\": \"application/json\"\n        },\n        \"self\": {\n            \"href\": \"/api/v2/members/5a57b98e659e4121a07aa841\",\n            \"type\": \"application/json\"\n        },\n        \"sendMfaEnableRequest\": {\n            \"href\": \"/api/v2/members/5a57b98e659e4121a07aa841/mfa/request\",\n            \"type\": \"application/json\"\n        }\n    },\n    \"_id\": \"5a57b98e659e4121a07aa841\",\n    \"role\": \"admin\",\n    \"email\": \"user+test@launchdarkly.com\",\n    \"_pendingInvite\": true,\n    \"isBeta\": false,\n    \"customRoles\": [],\n    \"mfa\": \"disabled\",\n    \"_access\": {\n        \"denied\": []\n    }\n}","name":""}]},"examples":{"codes":[{"language":"json","code":"   [\n      {\n        \"op\": \"replace\",\n        \"path\": \"/role\",\n        \"value\": \"admin\"\n      }\n    ]"}]},"auth":"required","params":[{"_id":"5a53e49a6693040032103ecd","ref":"","in":"path","required":false,"desc":"The ID of the member to update","default":"","type":"string","name":"id"}],"url":"/members/:id"},"isReference":false,"order":4,"body":"Update a single team member. The request should be a valid [JSON Patch document](doc:updates)  describing the changes to be made to the team member.","excerpt":"","slug":"update-team-member","type":"patch","title":"Update team member","__v":8,"parentDoc":null,"childrenPages":[]}

patchUpdate team member


Path Params

id:
string
The ID of the member to update
Update a single team member. The request should be a valid [JSON Patch document](doc:updates) describing the changes to be made to the team member.

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 single team member. The request should be a valid [JSON Patch document](doc:updates) describing the changes to be made to the team member.
{"_id":"5a53bbab55bec20012f0615b","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"59932b00b58e04000f14abd0","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-01-08T18:42:51.994Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":204,"language":"json","code":"{}","name":""}]},"settings":"57be249fddc0880e006f3b4a","auth":"required","params":[{"_id":"5a53e2504219040012424262","ref":"","in":"path","required":false,"desc":"The ID of the member to delete","default":"","type":"string","name":"id"}],"url":"/members/:id","examples":{"codes":[]},"method":"delete"},"isReference":false,"order":5,"body":"Delete a team member by ID.","excerpt":"","slug":"delete-team-member","type":"delete","title":"Delete team member","__v":5,"parentDoc":null,"childrenPages":[]}

deleteDelete team member


Path Params

id:
string
The ID of the member to delete
Delete a team member 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 }}

Result Format



Delete a team member by ID.
{"_id":"571fb616d9baf12900c62a4f","api":{"auth":"never","examples":{"codes":[]},"method":"get","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","order":0,"user":"5490ae350c7786160022fb4d","__v":0,"excerpt":"","project":"5490cc10751f9d21005fb9c3","slug":"root","title":"Root resource","updates":[],"version":"571fb615d9baf12900c62a14","hidden":false,"isReference":true,"link_external":false,"link_url":"","parentDoc":null,"sync_unique":"","type":"get","createdAt":"2014-12-19T18:08:53.466Z","githubsync":"","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.
{"_id":"5b33e7011d7a760003fc2eb4","project":"5490cc10751f9d21005fb9c3","version":"571fb615d9baf12900c62a14","category":"571fb615d9baf12900c62a1f","user":"5490ae350c7786160022fb4d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-06-27T19:35:29.265Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"get","examples":{"codes":[]},"results":{"codes":[{"status":200,"language":"json","code":"{\naddresses: [\n\"34.206.27.142/32\",\n\"34.205.234.124/32\",\n\"52.202.127.94/32\",\n\"18.210.78.7/32\",\n\"18.210.80.71/32\",\n\"34.203.32.107/32\",\n\"54.156.199.48/32\",\n\"34.197.0.51/32\",\n\"34.235.217.178/32\",\n\"34.192.196.169/32\",\n\"34.193.119.86/32\",\n\"34.231.253.69/32\",\n\"54.173.82.102/32\",\n\"34.199.172.173/32\",\n\"52.22.57.175/32\",\n\"34.201.185.120/32\",\n\"34.204.34.52/32\",\n\"52.73.50.228/32\",\n\"34.226.67.149/32\",\n\"34.234.154.56/32\",\n\"35.171.177.94/32\",\n\"34.231.182.239/32\",\n\"34.239.25.136/32\",\n\"34.207.48.208/32\",\n\"54.81.75.203/32\",\n\"34.194.116.133/32\",\n\"54.152.237.62/32\",\n\"52.5.168.121/32\",\n\"52.73.253.33/32\",\n\"52.72.163.42/32\",\n\"54.236.85.139/32\",\n\"52.6.61.222/32\",\n\"34.198.226.180/32\",\n\"52.7.94.112/32\",\n\"23.235.32.0/20\",\n\"43.249.72.0/22\",\n\"103.244.50.0/24\",\n\"103.245.222.0/23\",\n\"103.245.224.0/24\",\n\"104.156.80.0/20\",\n\"151.101.0.0/16\",\n\"157.52.64.0/18\",\n\"172.111.64.0/18\",\n\"185.31.16.0/22\",\n\"199.27.72.0/21\",\n\"199.232.0.0/16\",\n\"202.21.128.11/32\",\n\"202.21.128.12/32\",\n\"203.57.145.11/32\",\n\"203.57.145.12/32\"\n],\noutboundAddresses: [\n\"52.21.152.96/32\",\n\"52.200.35.24/32\",\n\"52.200.50.23/32\"\n]\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"57be249fddc0880e006f3b4a","auth":"never","params":[],"url":"/public-ip-list"},"isReference":true,"order":999,"body":"The Public IP list endpoint provides a list of IP ranges used by the LaunchDarkly service. This list can be used to whitelist LaunchDarkly through your firewall. \n\nThis endpoint returns a JSON object with two attributes: `addresses` and `outboundAddresses`. The `addresses` element contains the IP addresses used by our service. The `outboundAddresses` element contains the IP addresses used for outgoing webhook notifications.\n\nWe post upcoming changes to this list in advance on our [status page](https://status.launchdarkly.com).","excerpt":"","slug":"public-ip-list","type":"get","title":"Public IP list","__v":0,"childrenPages":[]}

getPublic IP list


The Public IP list endpoint provides a list of IP ranges used by the LaunchDarkly service. This list can be used to whitelist LaunchDarkly through your firewall. This endpoint returns a JSON object with two attributes: `addresses` and `outboundAddresses`. The `addresses` element contains the IP addresses used by our service. The `outboundAddresses` element contains the IP addresses used for outgoing webhook notifications. We post upcoming changes to this list in advance on our [status page](https://status.launchdarkly.com).

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



The Public IP list endpoint provides a list of IP ranges used by the LaunchDarkly service. This list can be used to whitelist LaunchDarkly through your firewall. This endpoint returns a JSON object with two attributes: `addresses` and `outboundAddresses`. The `addresses` element contains the IP addresses used by our service. The `outboundAddresses` element contains the IP addresses used for outgoing webhook notifications. We post upcoming changes to this list in advance on our [status page](https://status.launchdarkly.com).