For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Search for contexts.
You can use either the query parameters or the request body parameters. If both are provided, there is an error.
To learn more about the filter syntax, read Filtering contexts and context instances. To learn more about contexts, read Contexts and context kinds.
curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": "*.name startsWith Jo,kind anyOf [\"user\",\"organization\"]",
"sort": "-ts",
"limit": 10,
"continuationToken": "QAGFKH1313KUGI2351"
}
'{
"_environmentId": "57be1db38b75bf0772d11384",
"items": [
{
"context": "{\"kind\": \"user\", \"key\": \"context-key-123abc\", \"name\": \"Sandy Smith\", \"email\": \"sandy@example.com\"}",
"lastSeen": "2022-04-15T15:00:57.526470334Z",
"applicationId": "GoSDK/1.2",
"_links": {
"parent": {
"href": "/api/v2/projects/my-project/environments/my-environment",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project/environments/my-env/contexts/organization:launch-darkly:user:henry?filter=applicationId:\"GoSDK/1.2\"",
"type": "application/json"
},
"site": {
"href": "/my-project/my-environment/context/organization:launch-darkly:user:henry",
"type": "text/html"
}
},
"_access": {
"denied": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
],
"allowed": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
]
},
"associatedContexts": 0
}
],
"_links": {
"next": {
"href": "/app.launchdarkly.com/api/v2/projects/my-project/environments/my-environment/contexts?filter=kind:{\"equals\": [\"organization\"]}&limit=2&continuationToken=QAGFKH1313KUGI2351",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-proj/environments/my-env/contexts?filter=kind:{\"equals\": [\"organization\"]}&limit=2&continuationToken=QAGFKH1313KUGI2351",
"type": "application/json"
}
},
"totalCount": 100,
"continuationToken": "QAGFKH1313KUGI2351"
}Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The project key
The environment key
Specifies the maximum number of items in the collection to return (max: 50, default: 20)
Limits results to contexts with sort values after the value specified. You can use this for pagination, however, we recommend using the next link we provide instead.
Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying ts for this value, or descending order by specifying -ts.
A comma-separated list of context filters. To learn more about the filter syntax, read Filtering contexts and context instances.
Specifies whether to include or omit the total count of matching contexts. Defaults to true.
A collection of context filters
"*.name startsWith Jo,kind anyOf [\"user\",\"organization\"]"
Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying ts for this value, or descending order by specifying -ts.
"-ts"
Specifies the maximum number of items in the collection to return (max: 50, default: 20)
10
Limits results to contexts with sort values after the value specified. You can use this for pagination, however, we recommend using the next link instead, because this value is an obfuscated string.
"QAGFKH1313KUGI2351"
Contexts collection response
The environment ID where the context was evaluated
"57be1db38b75bf0772d11384"
A collection of contexts. Can include multiple versions of contexts that have the same kind and key, but different applicationIds.
Show child attributes
The location and content type of related resources
Show child attributes
{
"next": {
"href": "/app.launchdarkly.com/api/v2/projects/my-project/environments/my-environment/contexts?filter=kind:{\"equals\": [\"organization\"]}&limit=2&continuationToken=QAGFKH1313KUGI2351",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-proj/environments/my-env/contexts?filter=kind:{\"equals\": [\"organization\"]}&limit=2&continuationToken=QAGFKH1313KUGI2351",
"type": "application/json"
}
}
The number of contexts
100
An obfuscated string that references the last context instance on the previous page of results. You can use this for pagination, however, we recommend using the next link instead.
"QAGFKH1313KUGI2351"
curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": "*.name startsWith Jo,kind anyOf [\"user\",\"organization\"]",
"sort": "-ts",
"limit": 10,
"continuationToken": "QAGFKH1313KUGI2351"
}
'{
"_environmentId": "57be1db38b75bf0772d11384",
"items": [
{
"context": "{\"kind\": \"user\", \"key\": \"context-key-123abc\", \"name\": \"Sandy Smith\", \"email\": \"sandy@example.com\"}",
"lastSeen": "2022-04-15T15:00:57.526470334Z",
"applicationId": "GoSDK/1.2",
"_links": {
"parent": {
"href": "/api/v2/projects/my-project/environments/my-environment",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project/environments/my-env/contexts/organization:launch-darkly:user:henry?filter=applicationId:\"GoSDK/1.2\"",
"type": "application/json"
},
"site": {
"href": "/my-project/my-environment/context/organization:launch-darkly:user:henry",
"type": "text/html"
}
},
"_access": {
"denied": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
],
"allowed": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
]
},
"associatedContexts": 0
}
],
"_links": {
"next": {
"href": "/app.launchdarkly.com/api/v2/projects/my-project/environments/my-environment/contexts?filter=kind:{\"equals\": [\"organization\"]}&limit=2&continuationToken=QAGFKH1313KUGI2351",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-proj/environments/my-env/contexts?filter=kind:{\"equals\": [\"organization\"]}&limit=2&continuationToken=QAGFKH1313KUGI2351",
"type": "application/json"
}
},
"totalCount": 100,
"continuationToken": "QAGFKH1313KUGI2351"
}