Skip to main content
POST
/
api
/
v2
/
projects
/
{projectKey}
/
environments
/
{environmentKey}
/
flags
/
evaluate
Evaluate flags for context instance
curl --request POST \
  --url https://app.launchdarkly.com/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "key": "user-key-123abc",
  "kind": "user",
  "otherAttribute": "other attribute value"
}
'
{
  "items": [
    {
      "_links": {
        "self": {
          "href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate",
          "type": "application/json"
        },
        "site": {
          "href": "/my-project/my-environment/features/sort.order/targeting",
          "type": "text/html"
        }
      },
      "_value": true,
      "key": "sort.order",
      "name": "SortOrder",
      "reason": {
        "kind": "FALLTHROUGH"
      }
    },
    {
      "_links": {
        "self": {
          "href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate",
          "type": "application/json"
        },
        "site": {
          "href": "/my-project/my-environment/features/alternate.page/targeting",
          "type": "text/html"
        }
      },
      "_value": false,
      "key": "alternate.page",
      "name": "AlternatePage",
      "reason": {
        "kind": "RULE_MATCH",
        "ruleID": "b2530cdf-14c6-4e16-b660-00239e08f19b",
        "ruleIndex": 1
      }
    }
  ],
  "_links": {
    "self": {
      "href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate",
      "type": "application/json"
    }
  },
  "totalCount": 2
}

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.

Authorizations

Authorization
string
header
required

Path Parameters

projectKey
string<string>
required

The project key

environmentKey
string<string>
required

The environment key

Query Parameters

limit
integer<int64>

The number of feature flags to return. Defaults to -1, which returns all flags

offset
integer<int64>

Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query limit.

sort
string<string>

A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order

filter
string<string>

A comma-separated list of filters. Each filter is of the form field operator value. Supported fields are explained above.

Body

application/json
{key}
any

Response

Flag evaluation collection response

items
object[]
required

Details on the flag evaluations for this context instance

Example:
[
{
"_links": {
"self": {
"href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate",
"type": "application/json"
},
"site": {
"href": "/my-project/my-environment/features/sort.order/targeting",
"type": "text/html"
}
},
"_value": true,
"key": "sort.order",
"name": "SortOrder",
"reason": { "kind": "FALLTHROUGH" }
},
{
"_links": {
"self": {
"href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate",
"type": "application/json"
},
"site": {
"href": "/my-project/my-environment/features/alternate.page/targeting",
"type": "text/html"
}
},
"_value": false,
"key": "alternate.page",
"name": "AlternatePage",
"reason": {
"kind": "RULE_MATCH",
"ruleID": "b2530cdf-14c6-4e16-b660-00239e08f19b",
"ruleIndex": 1
}
}
]

The location and content type of related resources

Example:
{
"self": {
"href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate",
"type": "application/json"
}
}
totalCount
integer

The number of flags

Example:

2