LaunchDarkly Contexts API
Contexts 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.When 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. 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).LaunchDarkly provides APIs for you to:* retrieve contexts and context attribute names and values* search for contexts* fetch context kinds* create and update context kindsTo learn more about context kinds, read [Context kinds](https://launchdarkly.com/docs/home/observability/context-kinds).Contexts are always scoped within a project and an environment. Each environment has its own set of context records. Context records reflect the contexts that LaunchDarkly has received within the last 30 days.Some of the endpoints in the contexts API accept an application ID. The application ID is returned as the `applicationId` field of each element in the `items` array of the [Get contexts](https://launchdarkly.com/docs/api/contexts/get-contexts) response. 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).### Filtering contextsWhen you [search for contexts](https://launchdarkly.com/docs/api/contexts/search-contexts), you can filter the results using fields and operators with the `filter` parameter. Specify `filter` either as a query parameter or as a request body parameter.The `filter` parameter supports the following operators: `after`, `anyOf`, `before`, `contains`, `equals`, `exists`, `notEquals`, `startsWith`.Expand for details on operators and syntax#### afterReturns contexts if the field's date value occurs after the specified time. Provide an RFC 3339 timestamp or Unix epoch milliseconds. For example:* `myField after "2022-09-21T19:03:15+00:00"`#### anyOfReturns contexts if the field value matches any of the provided values. The `anyOf` operator is supported for the `applicationId`, `key`, `kind`, `kindKey`, `kindKeys`, and `kinds` fields only. To match an attribute against multiple values, use `equals` with an array value instead. For example:* `kind anyOf ["user","device"]`* `key anyOf ["user-key-123abc","user-key-456def"]`#### beforeReturns contexts if the field's date value occurs before the provided time. Provide an RFC 3339 timestamp or Unix epoch milliseconds. For example:* `myField before "2022-09-21T19:03:15+00:00"`#### containsReturns contexts whose kind or kind and key match the provided value. The `contains` operator is supported for the `kinds` and `kindKeys` fields only, and accepts exactly one value. For example:* `kinds contains ["user"]`* `kindKeys contains ["user:user-key-123abc"]`#### equalsReturns contexts only if the field value exactly matches the provided value. If you provide an array, the filter matches if the field value equals any element of the array. For example:* `myField equals 44`* `myField equals "device"`* `myField equals true`* `myField equals [1,2,3,4]`* `myField equals ["hello","goodbye"]`#### existsReturns contexts based on whether the specified field exists. The `exists` operator is supported for the `name` field and attribute fields only. For example:* `myField exists true`* `myField exists false`* `*.name exists true`#### notEqualsReturns contexts if the field value does not exactly match the provided value. If you provide an array, the filter matches if the field value does not equal any element of the array. For example:* `myField notEquals 44`* `myField notEquals "device"`* `myField notEquals true`* `myField notEquals [1,2,3,4]`* `myField notEquals ["hello","goodbye"]`#### startsWithReturns contexts if a singular string field value begins with the provided substring. The substring can be at most 500 characters. Matching is case-sensitive. For example:* `myField startsWith "do"`You can also combine filters in the following ways:* Use a comma (`,`) as an AND operator* Use a vertical bar (`|`) as an OR operator* Use parentheses `()` to group filtersFor example:* `myField notEquals 0, myField notEquals 1` returns contexts where `myField` is not 0 and is not 1* `myFirstField equals "device",(mySecondField equals "iPhone"|mySecondField equals "iPad")` returns contexts where `myFirstField` is equal to "device" and `mySecondField` is equal to either "iPhone" or "iPad"#### Supported fields and operatorsYou can only filter some fields using certain operators.When you search for [contexts](https://launchdarkly.com/docs/api/contexts/search-contexts), the `filter` parameter supports the following fields and operators:|Field |Description |Supported operators ||---|---|---||`applicationId` |An identifier that represents the application where the LaunchDarkly SDK is running. |`equals`, `notEquals`, `anyOf`, `startsWith` ||`key` |The context key. |`equals`, `notEquals`, `anyOf`, `startsWith` ||`kind` |The context kind. |`equals`, `notEquals`, `anyOf`, `startsWith` ||`kinds` |The context's kind. Supply a list of strings to the operator. The filter matches contexts whose kind is any of the provided values. The `contains` operator accepts exactly one value. |`equals`, `anyOf`, `contains` ||`kindKey` |The kind and key for the context, joined with a `:`. For example, `user:user-key-abc123`. |`equals`, `notEquals`, `anyOf` ||`kindKeys` |The kind and key for the context, joined with a `:`. For example, `user:user-key-abc123`. Supply a list of strings to the operator. The filter matches contexts whose kind and key match any of the provided values. The `contains` operator accepts exactly one value. |`equals`, `anyOf`, `contains` ||`q` |A prefix search across the context key and the `name`, `firstName`, `lastName`, and `email` attributes. Supply a single string to the operator. |`equals` ||`name` |The name for the context. |`equals`, `notEquals`, `exists`, `startsWith` ||`.` |A kind and the name of any attribute that appears in a context of that kind, for example, `user.email`. To filter all kinds use `*` in place of the kind. For example, `*.email`. Reference a nested attribute by joining path segments with periods. For example, `user.address.city` filters on the `city` field within the `address` attribute of a user context. Each path segment may contain letters, numbers, underscores, and hyphens, and may not start with a number. JSON pointer escaping (`~0`, `~1`) is not supported. If the value includes whitespace, enclose it in double quotes. A filter may include at most 10 attribute clauses. |`equals`, `notEquals`, `exists`, `startsWith`, `before`, `after`.|
LaunchDarkly Contexts API is one of 68 APIs that LaunchDarkly publishes on the APIs.io network, described by a machine-readable OpenAPI specification.
Tagged areas include Context. The published artifact set on APIs.io includes an OpenAPI specification.
This API exposes 7 operations across 7 paths, and defines 33 schemas. It is described by OpenAPI 3.2.0, at version 2.0.
Requests are made against 2 base URLs: https://app.launchdarkly.com, https://app.launchdarkly.us.
Metadata
The identity and technical contract details declared by the specification.
Authentication & Security 1
LaunchDarkly Contexts API declares
1 security scheme
for authenticating requests.
An API key is passed in the header as Authorization (ApiKey).
By default, every request must be authenticated.
Paths & Operations 7
Across 7 paths, the API surfaces 7 operations — 4 GET, 2 POST, 1 PUT. Each is listed below with its method, path, parameters, and response codes.
Contexts 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 resour…
Schemas 33
The contract defines 33 schemas that model the data the API accepts and returns. The most detailed are ContextKindRep (12 properties), ContextRecord (6 properties), AccessAllowedReason (6 properties), ContextInstanceEvaluationReason (6 properties). Each schema is shown below with its type and property counts.
Specification
The full machine-readable OpenAPI contract behind this narrative.
Source
More from LaunchDarkly 12
Other APIs LaunchDarkly publishes across the network.
This is an independent, third-party profile of LaunchDarkly Contexts API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.
The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.
Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.
info@apievangelist.com
·
Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and
you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.