Evaluates a feature flag for the given context.
POST
/v1/sdk/evaluate
const url = 'https://eval.featureflip.io/v1/sdk/evaluate';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"flagKey":"example","context":{"userId":"example","attributes":{"additionalProperty":"example"}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://eval.featureflip.io/v1/sdk/evaluate \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "flagKey": "example", "context": { "userId": "example", "attributes": { "additionalProperty": "example" } } }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”The evaluation request containing flag key and context.
object
flagKey
required
string
context
required
object
userId
string
attributes
object
key
additional properties
Examplegenerated
{ "flagKey": "example", "context": { "userId": "example", "attributes": { "additionalProperty": "example" } }}object
flagKey
required
string
context
required
object
userId
string
attributes
object
key
additional properties
Examplegenerated
{ "flagKey": "example", "context": { "userId": "example", "attributes": { "additionalProperty": "example" } }}object
flagKey
required
string
context
required
object
userId
string
attributes
object
key
additional properties
Examplegenerated
{ "flagKey": "example", "context": { "userId": "example", "attributes": { "additionalProperty": "example" } }}Responses
Section titled “Responses”Returns the evaluation result.
Media typeapplication/json
object
key
required
string
variation
required
string
value
required
reason
required
string
prerequisiteKey
string
Examplegenerated
{ "key": "example", "variation": "example", "value": "example", "reason": "example", "prerequisiteKey": "example"}SDK key is missing or invalid.
Media typeapplication/json
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Flag with the specified key was not found.
Media typeapplication/json
object
type
string
title
string
status
integer format: int32
detail
string
instance
string
key
additional properties
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Service Unavailable