@launchdarkly/ldcli
Version:
The official command line interface for managing LaunchDarkly feature flags.
86 lines • 2.01 MB
JSON
{
"openapi": "3.0.3",
"info": {
"title": "LaunchDarkly REST API",
"description": "This documentation describes LaunchDarkly's REST API.\n\nTo access the complete OpenAPI spec directly, use [Get OpenAPI spec](https://launchdarkly.com/docs/api/other/get-openapi-spec).\n\n## Authentication\n\nLaunchDarkly's REST API uses the HTTPS protocol with a minimum TLS version of 1.2.\n\nAll REST API resources are authenticated with either [personal or service access tokens](https://launchdarkly.com/docs/home/account/api), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [**Authorization**](https://app.launchdarkly.com/settings/authorization) page in the LaunchDarkly UI.\n\nLaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and JavaScript-based SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations such as fetching feature flag settings.\n\n| Auth mechanism | Allowed resources | Use cases |\n| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- |\n| [Personal or service access tokens](https://launchdarkly.com/docs/home/account/api) | Can be customized on a per-token basis | Building scripts, custom integrations, data export. |\n| SDK keys | Can only access read-only resources specific to server-side SDKs. Restricted to a single environment. | Server-side SDKs |\n| Mobile keys | Can only access read-only resources specific to mobile SDKs, and only for flags marked available to mobile keys. Restricted to a single environment. | Mobile SDKs |\n| Client-side ID | Can only access read-only resources specific to JavaScript-based client-side SDKs, and only for flags marked available to client-side. Restricted to a single environment. | Client-side JavaScript |\n\n> #### Keep your access tokens and SDK keys private\n>\n> 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 [**Authorization**](https://app.launchdarkly.com/settings/authorization) page.\n>\n> The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript.\n\n### Authentication using request header\n\nThe preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token.\n\nManage personal access tokens from the [**Authorization**](https://app.launchdarkly.com/settings/authorization) page.\n\n### Authentication using session cookie\n\nFor testing purposes, you can make API calls directly from your web browser. If you are logged in to the LaunchDarkly application, the API will use your existing session to authenticate calls.\n\nDepending on the permissions granted as part of your [role](https://launchdarkly.com/docs/home/account/roles), you may not have permission to perform some API calls. You will receive a `401` response code in that case.\n\n> ### Modifying the Origin header causes an error\n>\n> LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`.\n>\n> If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly.\n>\n> Any browser extension that intentionally changes the Origin header can cause this problem. For example, the `Allow-Control-Allow-Origin: *` Chrome extension changes the Origin header to `http://evil.com` and causes the app to fail.\n>\n> To prevent this error, do not modify your Origin header.\n>\n> LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage.\n\n## Representations\n\nAll resources expect and return JSON response bodies. Error responses also send a JSON body. To learn more about the error format of the API, read [Errors](https://launchdarkly.com/docs/api#errors).\n\nIn practice this means that you always get a response with a `Content-Type` header set to `application/json`.\n\nIn addition, request bodies for `PATCH`, `POST`, and `PUT` requests must be encoded as JSON with a `Content-Type` header set to `application/json`.\n\n### Summary and detailed representations\n\nWhen you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource, such as a single feature flag, you receive a _detailed representation_ 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\n### Expanding responses\n\nSometimes the detailed representation of a resource does not include all of the attributes of the resource by default. If this is the case, the request method will clearly document this and describe which attributes you can include in an expanded response.\n\nTo include the additional attributes, append the `expand` request parameter to your request and add a comma-separated list of the attributes to include. For example, when you append `?expand=members,maintainers` to the [Get team](https://launchdarkly.com/docs/api/teams/get-team) endpoint, the expanded response includes both of these attributes.\n\n### Links and addressability\n\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:\n\n- An `href`, which contains the URL\n- A `type`, which describes the content type\n\nFor example, a feature resource might return the following:\n\n```json\n{\n \"_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}\n```\n\nFrom this, you 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 have `_links` defined at the top level.\n\nPaginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection.\n\n## Updates\n\nResources that accept partial updates use the `PATCH` verb. Most resources support the [JSON patch](https://launchdarkly.com/docs/api#updates-using-json-patch) format. Some resources also support the [JSON merge patch](https://launchdarkly.com/docs/api#updates-using-json-merge-patch) format, and some resources support the [semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch) format, which is a way to specify the modifications to perform as a set of executable instructions. Each resource supports optional [comments](https://launchdarkly.com/docs/api#updates-with-comments) that you can submit with updates. Comments appear in outgoing webhooks, the audit log, and other integrations.\n\nWhen a resource supports both JSON patch and semantic patch, we document both in the request method. However, the specific request body fields and descriptions included in our documentation only match one type of patch or the other.\n\n### Updates using JSON patch\n\n[JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. JSON patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. JSON patch documents are always arrays, where each element contains an operation, a path to the field to update, and the new value.\n\nFor example, in this feature flag representation:\n\n```json\n{\n \"name\": \"New recommendations engine\",\n \"key\": \"engine.enable\",\n \"description\": \"This is the description\",\n ...\n}\n```\nYou can change the feature flag's description with the following patch document:\n\n```json\n[{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\" }]\n```\n\nYou can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch:\n\n```json\n[\n { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 },\n { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }\n]\n```\n\nThe above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description.\n\nAttributes that are not editable, such as a resource's `_links`, have names that start with an underscore.\n\n### Updates using JSON merge patch\n\n[JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) is another format for specifying the modifications to perform on a resource. JSON merge patch is less expressive than JSON patch. However, in many cases it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document:\n\n```json\n{\n \"description\": \"New flag description\"\n}\n```\n\n### Updates using semantic patch\n\nSome resources support the semantic patch format. A semantic patch is a way to specify the modifications to perform on a resource as a set of executable instructions.\n\nSemantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, you can define semantic patch instructions independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header.\n\nHere's how:\n\n```\nContent-Type: application/json; domain-model=launchdarkly.semanticpatch\n```\n\nIf you call a semantic patch resource without this header, you will receive a `400` response because your semantic patch will be interpreted as a JSON patch.\n\nThe body of a semantic patch request takes the following properties:\n\n* `comment` (string): (Optional) A description of the update.\n* `environmentKey` (string): (Required for some resources only) The environment key.\n* `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the instruction requires parameters, you must include those parameters as additional fields in the object. The documentation for each resource that supports semantic patch includes the available instructions and any additional parameters.\n\nFor example:\n\n```json\n{\n \"comment\": \"optional comment\",\n \"instructions\": [ {\"kind\": \"turnFlagOn\"} ]\n}\n```\n\nSemantic patches are not applied partially; either all of the instructions are applied or none of them are. If **any** instruction is invalid, the endpoint returns an error and will not change the resource. If all instructions are valid, the request succeeds and the resources are updated if necessary, or left unchanged if they are already in the state you request.\n\n### Updates with comments\n\nYou can submit optional comments with `PATCH` changes.\n\nTo submit a comment along with a JSON patch document, use the following format:\n\n```json\n{\n \"comment\": \"This is a comment string\",\n \"patch\": [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }]\n}\n```\n\nTo submit a comment along with a JSON merge patch document, use the following format:\n\n```json\n{\n \"comment\": \"This is a comment string\",\n \"merge\": { \"description\": \"New flag description\" }\n}\n```\n\nTo submit a comment along with a semantic patch, use the following format:\n\n```json\n{\n \"comment\": \"This is a comment string\",\n \"instructions\": [ {\"kind\": \"turnFlagOn\"} ]\n}\n```\n\n## Errors\n\nThe API always returns errors in a common format. Here's an example:\n\n```json\n{\n \"code\": \"invalid_request\",\n \"message\": \"A feature with that key already exists\",\n \"id\": \"30ce6058-87da-11e4-b116-123b93f75cba\"\n}\n```\n\nThe `code` indicates the general class of error. 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.\n\n### HTTP status error response codes\n\n| Code | Definition | Description | Possible Solution |\n| ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| 400 | Invalid request | The request cannot be understood. | Ensure JSON syntax in request body is correct. |\n| 401 | Invalid access token | Requestor is unauthorized or does not have permission for this API call. | Ensure your API access token is valid and has the appropriate permissions. |\n| 403 | Forbidden | Requestor does not have access to this resource. | Ensure that the account member or access token has proper permissions set. |\n| 404 | Invalid resource identifier | The requested resource is not valid. | Ensure that the resource is correctly identified by ID or key. |\n| 405 | Method not allowed | The request method is not allowed on this resource. | Ensure that the HTTP verb is correct. |\n| 409 | Conflict | The API request can not be completed because it conflicts with a concurrent API request. | Retry your request. |\n| 422 | Unprocessable entity | The API request can not be completed because the update description can not be understood. | Ensure that the request body is correct for the type of patch you are using, either JSON patch or semantic patch.\n| 429 | Too many requests | Read [Rate limiting](https://launchdarkly.com/docs/api#rate-limiting). | Wait and try again later. |\n\n## CORS\n\nThe 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 the request returns a wildcard, `Access-Control-Allow-Origin: *`. For more information on CORS, read the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like:\n\n```http\nAccess-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```\n\nYou can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](https://launchdarkly.com/docs/api#authentication). If you are using session authentication, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted entities.\n\n## Rate limiting\n\nWe use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs return a `429` status code. Calls to our APIs 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\n> ### Rate limiting and SDKs\n>\n> LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs.\n\n### Global rate limits\n\nAuthenticated requests are subject to a global limit. This is the maximum number of calls that your account can make to the API per ten seconds. All service and 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 may return the headers below:\n\n| Header name | Description |\n| ------------------------------ | -------------------------------------------------------------------------------- |\n| `X-Ratelimit-Global-Remaining` | The maximum number of requests the account is permitted to make per ten seconds. |\n| `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. |\n\nWe do not publicly document the specific number of calls that can be made globally. This limit may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limit.\n\n### Route-level rate limits\n\nSome authenticated routes have custom rate limits. These also reset every ten seconds. Any service or personal 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 return the headers below:\n\n| Header name | Description |\n| ----------------------------- | ----------------------------------------------------------------------------------------------------- |\n| `X-Ratelimit-Route-Remaining` | The maximum number of requests to the current route the account is permitted to make per ten seconds. |\n| `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. |\n\nA _route_ represents a specific URL pattern and verb. For example, the [Delete environment](https://launchdarkly.com/docs/api/environments/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\nWe do not publicly document the specific number of calls that an account can make to each endpoint per ten seconds. These limits may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limits.\n\n### IP-based rate limiting\n\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.\n\n## OpenAPI (Swagger) and client libraries\n\nWe have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API.\n\nWe auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit the [collection of client libraries on GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories). You can also use this specification to generate client libraries to interact with our REST API in your language of choice.\n\nOur OpenAPI specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to explore our APIs.\n\n## Method overriding\n\nSome firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `DELETE`, `PATCH`, and `PUT` verbs are inaccessible.\n\nTo avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `DELETE`, `PATCH`, and `PUT` requests using a `POST` request.\n\nFor example, to call a `PATCH` endpoint using a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header.\n\n## Beta resources\n\nWe sometimes release new API resources in **beta** status before we release them with general availability.\n\nResources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nWe try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes.\n\nWe mark beta resources with a \"Beta\" callout in our documentation, pictured below:\n\n> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](https://launchdarkly.com/docs/api#beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\n### Using beta resources\n\nTo use a beta resource, you must include a header in the request. If you call a beta resource without this header, you receive a `403` response.\n\nUse this header:\n\n```\nLD-API-Version: beta\n```\n\n## Federal environments\n\nThe version of LaunchDarkly that is available on domains controlled by the United States government is different from the version of LaunchDarkly available to the general public. If you are an employee or contractor for a United States federal agency and use LaunchDarkly in your work, you likely use the federal instance of LaunchDarkly.\n\nIf you are working in the federal instance of LaunchDarkly, the base URI for each request is `https://app.launchdarkly.us`.\n\nTo learn more, read [LaunchDarkly in federal environments](https://launchdarkly.com/docs/home/infrastructure/federal).\n\n## Versioning\n\nWe try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly.\n\nUpdates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace.\n\n### Setting the API version per request\n\nYou can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below:\n\n```\nLD-API-Version: 20240415\n```\n\nThe header value is the version number of the API version you would like to request. The number for each version corresponds to the date the version was released in `yyyymmdd` format. In the example above the version `20240415` corresponds to April 15, 2024.\n\n### Setting the API version per access token\n\nWhen you create an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes.\n\nTokens created before versioning was released have their version set to `20160426`, which is the version of the API that existed before the current versioning scheme, so that they continue working the same way they did before versioning.\n\nIf you would like to upgrade your integration to use a new API version, you can explicitly set the header described above.\n\n> ### Best practice: Set the header for every client or integration\n>\n> We recommend that you set the API version header explicitly in any client or integration you build.\n>\n> Only rely on the access token API version during manual testing.\n\n### API version changelog\n\n<table>\n <tr>\n <th>Version</th>\n <th>Changes</th>\n <th>End of life (EOL)</th>\n </tr>\n <tr>\n <td>`20240415`</td>\n <td>\n <ul><li>Changed several endpoints from unpaginated to paginated. Use the `limit` and `offset` query parameters to page through the results.</li> <li>Changed the [list access tokens](https://launchdarkly.com/docs/api/access-tokens/get-tokens) endpoint: <ul><li>Response is now paginated with a default limit of `25`</li></ul></li> <li>Changed the [list account members](https://launchdarkly.com/docs/api/account-members/get-members) endpoint: <ul><li>The `accessCheck` filter is no longer available</li></ul></li> <li>Changed the [list custom roles](https://launchdarkly.com/docs/api/custom-roles/get-custom-roles) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li></ul></li> <li>Changed the [list feature flags](https://launchdarkly.com/docs/api/feature-flags/get-feature-flags) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li><li>The `environments` field is now only returned if the request is filtered by environment, using the `filterEnv` query parameter</li><li>The `followerId`, `hasDataExport`, `status`, `contextKindTargeted`, and `segmentTargeted` filters are no longer available</li><li>The `compare` query parameter is no longer available</li></ul></li> <li>Changed the [list segments](https://launchdarkly.com/docs/api/segments/get-segments) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li></ul></li> <li>Changed the [list teams](https://launchdarkly.com/docs/api/teams/get-teams) endpoint: <ul><li>The `expand` parameter no longer supports including `projects` or `roles`</li><li>In paginated results, the maximum page size is now 100</li></ul></li> <li>Changed the [get workflows](https://launchdarkly.com/docs/api/workflows/get-workflows) endpoint: <ul><li>Response is now paginated with a default limit of `20`</li><li>The `_conflicts` field in the response is no longer available</li></ul></li> </ul>\n </td>\n <td>Current</td>\n </tr>\n <tr>\n <td>`20220603`</td>\n <td>\n <ul><li>Changed the [list projects](https://launchdarkly.com/docs/api/projects/get-projects) return value:<ul><li>Response is now paginated with a default limit of `20`.</li><li>Added support for filter and sort.</li><li>The project `environments` field is now expandable. This field is omitted by default.</li></ul></li><li>Changed the [get project](https://launchdarkly.com/docs/api/projects/get-project) return value:<ul><li>The `environments` field is now expandable. This field is omitted by default.</li></ul></li></ul>\n </td>\n <td>2025-04-15</td>\n </tr>\n <tr>\n <td>`20210729`</td>\n <td>\n <ul><li>Changed the [create approval request](https://launchdarkly.com/docs/api/approvals/post-approval-request) return value. It now returns HTTP Status Code `201` instead of `200`.</li><li> Changed the [get user](https://launchdarkly.com/docs/api/users/get-user) return value. It now returns a user record, not a user. </li><li>Added additional optional fields to environment, segments, flags, members, and segments, including the ability to create big segments. </li><li> Added default values for flag variations when new environments are created. </li><li>Added filtering and pagination for getting flags and members, including `limit`, `number`, `filter`, and `sort` query parameters. </li><li>Added endpoints for expiring user targets for flags and segments, scheduled changes, access tokens, Relay Proxy configuration, integrations and subscriptions, and approvals. </li></ul>\n </td>\n <td>2023-06-03</td>\n </tr>\n <tr>\n <td>`20191212`</td>\n <td>\n <ul><li>[List feature flags](https://launchdarkly.com/docs/api/feature-flags/get-feature-flags) now defaults to sending summaries of feature flag configurations, equivalent to setting the query parameter `summary=true`. Summaries omit flag targeting rules and individual user targets from the payload. </li><li> Added endpoints for flags, flag status, projects, environments, audit logs, members, users, custom roles, segments, usage, streams, events, and data export. </li></ul>\n </td>\n <td>2022-07-29</td>\n </tr>\n <tr>\n <td>`20160426`</td>\n <td>\n <ul><li>Initial versioning of API. Tokens created before versioning have their version set to this.</li></ul>\n </td>\n <td>2020-12-12</td>\n </tr>\n</table>\n\nTo learn more about how EOL is determined, read LaunchDarkly's [End of Life (EOL) Policy](https://launchdarkly.com/policies/end-of-life-policy/).\n",
"contact": {
"name": "LaunchDarkly Technical Support Team",
"url": "https://support.launchdarkly.com",
"email": "support@launchdarkly.com"
},
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0"
},
"version": "2.0"
},
"servers": [
{
"url": "https://app.launchdarkly.com",
"description": " Default"
},
{
"url": "https://app.launchdarkly.us",
"description": " Federal"
}
],
"security": [
{
"ApiKey": [
"read",
"write"
]
}
],
"tags": [
{
"name": "Access tokens",
"description": "The access tokens API allows you to list, create, modify, and delete access tokens programmatically.\n\nWhen using access tokens to manage access tokens, the following restrictions apply:\n- Personal tokens can see all service tokens and other personal tokens created by the same team member. If the personal token has the \"Admin\" role, it may also see other member's personal tokens. To learn more, read [Personal tokens](https://launchdarkly.com/docs/home/account/api#personal-tokens).\n- Service tokens can see all service tokens. If the token has the \"Admin\" role, it may also see all personal tokens. To learn more, read [Service tokens](https://launchdarkly.com/docs/home/account/api#service-tokens).\n- Tokens can only manage other tokens, including themselves, if they have \"Admin\" role or explicit permission via a custom role. To learn more, read [Personal access token actions](https://launchdarkly.com/docs/home/team/role-actions#personal-access-token-actions).\n\nSeveral of the endpoints in the access tokens API require an access token ID. The access token ID is returned as part of the [Create access token](https://launchdarkly.com/docs/api/access-tokens/post-token) and [List access tokens](https://launchdarkly.com/docs/api/access-tokens/get-tokens) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n\nTo learn more about access tokens, read [API access tokens](https://launchdarkly.com/docs/home/account/api).\n"
},
{
"name": "Account members",
"description": "The account members API allows you to invite new members to an account by making a `POST` request to `/api/v2/members`. When you invite a new member to an account, an invitation is sent to the email you provided. Members with Admin or Owner roles may create new members, as well as anyone with a `createMember` permission for \"member/\\*\". To learn more, read [LaunchDarkly account members](https://launchdarkly.com/docs/home/account/members).\n\nAny member may request the complete list of account members with a `GET` to `/api/v2/members`.\n\nSeveral of the endpoints in the account members API require a member ID. The member ID is returned as part of the [Invite new members](https://launchdarkly.com/docs/api/account-members/post-members) and [List account members](https://launchdarkly.com/docs/api/account-members/get-members) responses. It is the `_id` field of each element in the `items` array.\n"
},
{
"name": "Account members (beta)",
"description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](https://launchdarkly.com/docs/api#beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n"
},
{
"name": "Account usage (beta)",
"description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](https://launchdarkly.com/docs/api#beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nThe account usage API lets you query for metrics about how your account is using LaunchDarkly. To learn more, read [Account usage metrics](https://launchdarkly.com/docs/home/account/metrics).\n\nEach endpoint returns time-series data in the form of an array of data points with timestamps. Each one contains data for that time from one or more series. It also includes a metadata array describing what each of the series is.\n"
},
{
"name": "AI Configs (beta)",
"description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](https://launchdarkly.com/docs/api#beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\nThe AI Configs API allows you to create, retrieve, and edit AI Configs, AI Config variations, and AI model configurations.\n\nAn AI Config is a resource in LaunchDarkly that you can use to customize, test, and roll out new large language models (LLMs) within your generative AI applications. Within each AI Config, you define one or more AI Config variations, each of which includes a model configuration and one or more messages. The model configuration can be a standard one from the list provided by LaunchDarkly, or you can define your own custom AI model configuration.\n\nTo learn more, read [AI Configs](https://launchdarkly.com/docs/home/ai-configs).\n"
},
{
"name": "Announcements",
"description": "The announcements API lets you create and update a custom announcement banner that appears in the LaunchDarkly user interface for everyone in your organization. You can use the banner to display organization-wide information, such as upcoming holidays, code freeze periods, or reminders on best practices. You can have one banner visible at a time.\n\nTo learn more, read [Organization announcements](https://launchdarkly.com/docs/home/account/org-announcements).\n"
},
{
"name": "Applications (beta)",
"description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](https://launchdarkly.com/docs/api#beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nThe applications API lets you create, update, delete, and search for applications and application versions.\n\nEach application includes information about the app you're creating, and a set of versions of the app that you've released. You can use applications to target particular application versions in your feature flags more easily, and to handle unsupported application versions more gracefully.\n\nIn addition to creating applications through the applications API, you can also create applications in the LaunchDarkly user interface. To learn more, read [Applications and application versions](https://launchdarkly.com/docs/home/releases/applications). LaunchDarkly also creates applications and application versions automatically when a LaunchDarkly SDK evaluates a feature flag for a context that includes application information. To learn more, read [Automatic environment attributes](https://launchdarkly.com/docs/sdk/features/environment-attributes).\n\nYou can use an application in any project in your LaunchDarkly account.\n\n### Filtering applications and application versions\n\nThe `filter` parameter supports the following operators: `equals`, `notEquals`, `anyOf`, `startsWith`.\n\nYou can also combine filters in the following ways:\n\n- Use a comma (`,`) as an AND operator\n- Use a vertical bar (`|`) as an OR operator\n- Use parentheses (`()`) to group filters\n\n#### Supported fields and operators\n\nYou can only filter certain fields in applications when using the `filter` parameter. Additionally, you can only filter some fields with certain operators.\n\nWhen you search for applications, the `filter` parameter supports the following fields and operators:\n\n|<div style=\"width:120px\">Field</div> |Description |Supported operators |\n|---|---|---|\n|`key` | The application or application version key, a unique identifier |`equals`, `notEquals`, `anyOf` |\n|`name` | The application name or application version name |`equals`, `notEquals`, `anyOf`, `startsWith` |\n|`autoAdded` | Whether the application or application version was automatically created because it was included in a context when a LaunchDarkly SDK evaluated a feature flag, or was created through the LaunchDarkly UI or REST API |`equals`, `notEquals` |\n|`kind` | The application kind, one of `mobile`, `server`, `browser`. Only available for [Get applications](https://launchdarkly.com/docs/api/applications-beta/get-applications). |`equals`, `notEquals`, `anyOf` |\n|`supported` | Whether a mobile application version is supported or unsupported. Only available for [Get application versions by application key](https://launchdarkly.com/docs/api/applications-beta/get-application-versions).|`equals`, `notEquals` |\n\nFor example, the filter `?filter=kind anyOf [\"mobile\", \"server\"]` matches applications whose `kind` is either `mobile` or `server`. The filter is not case-sensitive.\n\nThe documented values for `filter` query parameters are prior to URL encoding. For example, the `[` in `?filter=kind anyOf [\"mobile\", \"server\"]` must be encoded to `%5B`.\n\n### Sorting applications and application versions\n\nLaunchDarkly supports the following fields for sorting:\n- `name` sorts by application name.\n- `creationDate` sorts by the creation date of the application.\n\nBy default, the sort is in ascending order. Use `-` to sort in descending order. For example, `?sort=name` sorts the response by application name in ascending order, and `?sort=-name` sorts in descending order.\n"
},
{
"name": "Approvals",
"description": "An account member can request approval on changes to a flag's targeting or variations, or to a segment's targeting. Members may be required to request approval depending on the settings in their LaunchDarkly project. Members can optionally request an approval even if it is not required.\n\nAn approval request prevents a change from being applied without approval from another member. Select up to ten members as reviewers. Reviewers receive an email notification, but anyone with sufficient permissions can review a pending approval request. A change needs at least one approval before you can apply it. To learn more, read [Approvals](https://launchdarkly.com/docs/home/releases/approvals).\n\nChanges that conflict will fail if approved and applied, and the flag or segment will not be updated.\n\nSeveral of the endpoints in the approvals API require an approval request ID. The approval request ID is returned as part of the [Create approval request](https://launchdarkly.com/docs/api/approvals/post-approval-request) and [List approval requests for a flag](https://launchdarkly.com/docs/api/approvals/get-approvals-for-flag) responses. It is the `_id` field, or the `_id` field of each element in the `items` array. If you created the approval request as part of a [workflow](https://launchdarkly.com/docs/api/workflows), you can also use a workflow ID as the approval request ID. The workflow ID is returned as part of the [Create workflow](https://launchdarkly.com/docs/api/workflows/post-workflow) and [Get workflows](https://launchdarkly.com/docs/api/workflows/get-workflows) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n"
},
{
"name": "Approvals (beta)",
"description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](https://launchdarkly.com/docs/api#beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n"
},
{
"name": "Audit log",
"description": "LaunchDarkly maintains a record of all the changes made to any resource in the system. You can access this history using the audit log API, including filtering by timestamps, or using a custom policy to select which entries to receive.\n\nSeveral of the endpoints in the audit log API require an audit log entry ID. The audit log entry ID is returned as part of the [List audit log entries](https://launchdarkly.com/docs/api/audit-log/get-audit-log-entries) response. It is the `_id` field of each element in the `items` array.\n\nIn the LaunchDarkly UI, this information appears on the **Change history** page. To learn more, read [Change history](https://launchdarkly.com/docs/home/observability/change-history).\n"
},
{
"name": "Code references",
"description": "> ### Code references is an Enterprise feature\n>\n> Code references is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\n> ### Use ld-find-code-refs\n>\n> LaunchDarkly provides the [ld-find-code-refs utility](https://github.com/launchdarkly/ld-find-code-refs) that creates repository connections, generates code reference data, and creates calls to the code references API. Most customers do not need to call this API directly.\n\nThe code references API provides access to all resources related to each connected repository, and associated feature flag code reference data for all branches. To learn more, read [Code references](https://launchdarkly.com/docs/home/observability/code-references).\n"
},
{
"name": "Context settings",
"description": "You can use the context settings API to assign a context to a specific variation for any feature flag. To learn more, read [View and manage contexts](https://launchdarkly.com/docs/home/observability/context-attributes#view-and-manage-contexts).\n"
},
{
"name": "Contexts",
"description": "\nContexts are people, services, machines, or other resources that encounter feature flags in your product. Contexts are identified by their `kind`, which describes the type of resources encountering flags, and by their `key`. Each unique combination of one or more contexts that have encountered a feature flag in your product is called a context instance.\n\nWhen you use the LaunchDarkly SDK to evaluate a flag, you provide a context to that call. LaunchDarkly records the key and attributes of each context instance. You can view these in the LaunchDarkly user interface from the **Contexts** list, or use the Context APIs. To learn more, read [Contexts](https://launchdarkly.com/docs/home/observability/contexts).\n\nLaunchDarkly provides APIs for you to:\n\n* retrieve contexts, context instances, and context attribute names and values\n* search for contexts or context instances\n* delete context instances\n* fetch context kinds\n* create and update context kinds\n\nTo learn more about context kinds, read [Context kinds](https://launchdarkly.com/docs/home/observability/context-kinds).\n\nContexts are always scoped within a project and an environment. Each environment has its own set of context instance records.\n\nSeveral of the endpoints in the contexts API require a context instance ID or application ID. Both of these IDs are returned as part of the [Search for context instances](https://launchdarkly.com/docs/api/contexts/search-context-instances) response. The context instance ID is the `id` field of each element in the `items` array. The application ID is the `applicationId` field of each element in the `items` array. By default, the application ID is set to the SDK you are using. In the LaunchDarkly UI, the application ID and application version appear on the context details page in the \"From source\" field. You can change the application ID as part of your SDK configuration. To learn more, read [Application metadata configuration](https://launchdarkly.com/docs/sdk/features/app-config).\n\n### Filtering contexts and context instances\n\nWhen you [search for contexts](https://launchdarkly.com/docs/api/contexts/search-contexts) or [context instances](https://launchdarkly.com/docs/api/contexts/search-context-instances), you can filter on certain fields using the `filter` parameter either as a query parameter or as a request body parameter.\n\nThe `filter` parameter supports the following operators: `after`, `anyOf`, `before`, `contains`, `equals`, `exists`, `notEquals`, `startsWith`.\n\n<details>\n<summary>Expand for details on operators and syntax</summary>\n\n#### after\n\nReturns contexts or context instances if any of the values in a field, which should be dates, are after the provided time. For example:\n\n* `myField after \"2022-09-21T19:03:15+00:00\"`\n\n#### anyOf\n\nReturns contexts or context instances if any of the values in a field match any of the values in the match value. For example:\n\n* `myField anyOf [44]`\n* `myField anyOf [\"phone\",\"tablet\"]`\n* `myField anyOf [true]\"`\n\n#### before\n\nReturns contexts or context instances if any of the values in a field, which should be dates, are before the provided time. For example:\n\n* `myField before \"2022-09-21T19:03:15+00:00\"`\n\n#### contains\n\nReturns contexts or context instances if all the match values are found in the list of values in this field. For example:\n\n* `myListField contains 44`\n* `myListField contains [\"phone\",\"tablet\"]`\n* `myListField contains true`\n\n#### equals\n\nReturns contexts or context instances if there is an exact match on the entire field. For example:\n\n* `myField equals 44`\n* `myField equals \"device\"`\n* `myField equals true`\n* `myField equals [1,2,3,4]`\n* `myField equals [\"hello\",\"goodbye\"]`\n\n#### exists\n\nReturns contexts or context instances if the field matches the specified existence. For example:\n\n* `myField exists true`\n* `myField exists false`\n* `*.name exists true`\n\n#### notEquals\n\nReturns contexts or context instances if there is not an exact match on the entire field. For example:\n\n* `myField notEquals 44`\n* `myField notEquals \"device\"`\n* `myField notEquals true`\n* `myField notEquals [1,2,3,4]`\n* `myField notEquals [\"hello\",\"goodbye\"]`\n\n#### startsWith\n\nReturns contexts or context instances if the value in a field, which should be a singular string, begins with the provided substring. For example:\n\n* `myField startsWith \"do\"`\n\n</details>\n\nYou can also combine filters in the following ways:\n\n* Use a comma (`,`) as an AND operator\n* Use a vertical bar (`|`) as an OR operator\n* Use parentheses `()` to group filters\n\nFor example:\n\n* `myField notEquals 0, myField notEquals 1` returns contexts or context instances where `myField` is not 0 and is not 1\n* `myFirstField equals \"device\",(mySecondField equals \"iPhone