Skip to content

Client HTTP API

This api can be used by your applications to get the latest feature values, it is recommended you use one of the SDKs over the HTTP API directly.

MethodPath
GET/effective?audiences=
GET/all

GET /effective?audiences=

Returns a list of the effective feature values for the set of audiences in a environment.

GET /effective?audiences=
json
[
{
"featureKey": "string",
"value": "string | boolean | number"
}
]

Query Parameters:

ParameterTypeRequiredDescription
audiencesstringTrueCSV of the audiences you want to receive effective feature values for

Request Headers:

HeaderTypeRequiredDescription
x-environment-keystringTrueFeatureBoard environment key
if-none-matchstringFalseETag value of earlier retrieved feature values

Note:
The x-environment-key header is required for authentication.
If if-none-match header is set, the request will return 200 (OK) together with the effective features if change has occurred. Otherwise it will return 304 (Not Modified).

Responses

Array<{
featureKey: string
value: string | boolean | number
}>

Response Status:

HTTP Status CodeDescription
200 (OK)Success. The response describes the list of effective feature values.
304 (Not Modified)Success. The response describes the list of effective feature values has not changed since last if-none-match request header value.

Response Headers:

HeaderTypeDescription
etagstringETag value for the version of effective feature values.
x-api-warningsstringProvide warning messages, including notifications about an impending API key expiration in case of a canceled subscription.
x-api-errorsstringCommunicates error messages or notifications related to encountered issues or faults during API operations.

Example

Request

GET /effective?audiences=plan-trial,role-admin
x-environment-key: "ck8p6tsni0000wnvi07jrxkm1"
if-none-match: "W/\"datetime'2023-08-15T08:19:20.520Z'\""

Note: The format of the etag value may change in the feature. Do not relay on it being timestamp in ISO 8601 format.

Response

HTTP/1.1 200 OK
etag: W/\"datetime'2023-08-16T02:46:10.220Z'\"
x-api-warnings: "Your subscription has been canceled. Your API key will expire in 2 days"
[
{ "featureKey": "permission-user-write", "value": true },
{ "featureKey": "limit-users", "value": 5 }
]

GET /all

Returns a list of all feature values and audience exceptions for a environment.

GET /all
json
[
{
"featureKey": "string",
"defaultValue": "string | boolean | number",
"audienceExceptions": [
"audienceKey": "string",
"value": "string | boolean | number",
]
}
]

Request Headers:

HeaderTypeRequiredDescription
x-environment-keystringTrueFeatureBoard environment key.
if-none-matchstringFalseETag value of earlier retrieved feature values.

Note:
The x-environment-key header is required for authentication.
If if-none-match header is set, the request will return 200 (OK) together with features values if change has occurred. Otherwise it will return 304 (Not Modified).

Responses

Array<{
featureKey: string
defaultValue: string | boolean | number
audienceExceptions: Array<{
audienceKey: string
value: string | boolean | number
}>
}>

Response Status:

HTTP Status CodeDescription
200 (OK)Success. The response describes the list of feature values and audience exceptions.
304 (Not Modified)Success. The response describes the list of feature values and audience exceptions has not changed since last if-none-match request header value.
401 (Unauthorized)Failure.

Response Headers:

HeaderTypeDescription
etagstringETag value for the version of feature values and audience exceptions.
x-api-warningsstringProvide warning messages, including notifications about an impending API key expiration in case of a canceled subscription.
x-api-errorsstringCommunicates error messages or notifications related to encountered issues or faults during API operations.

Example

Request

GET /all
x-environment-key: "ck8p6tsni0000wnvi07jrxkm1"
if-none-match: "W/\"datetime'2023-08-15T08:19:20.520Z'\""

Note: The format of the etag value may change in the feature. Do not relay on it being a timestamp in ISO 8601 format.

Response

HTTP/1.1 200 OK
etag: W/\"datetime'2023-08-16T02:46:10.220Z'\"
[
{
"featureKey": "permission-user-write",
"defaultValue": false,
"audienceExceptions": [
{
"audienceKey": "plan-trail-expired",
"value": false
},
{
"audienceKey": "role-admin",
"value": true
},
{
"audienceKey": "role-writer",
"value": true
}
]
},
{
"featureKey": "limit-users",
"defaultValue": 1,
"audienceExceptions": [
{
"audienceKey": "plan-large",
"value": 100
},
{
"audienceKey": "plan-small",
"value": 10
},
{
"audienceKey": "plan-trial",
"value": 5
}
]
},
]

Rate limiting

In order to prevent overuse of resources, our API enforces rate limits. If the rate limit is exceeded, an HTTP status code 429 (Too Many Requests) is returned, indicating the request cannot be processed due to excessive requests. The API response header, retry-after includes a recommend wait time for the next attempt.

We recommend API users to implement error handling to detect HTTP error code 429 and wait the number of seconds specified in the retry-after header before retrying the request.

Example response

When a rate limit has been exceeded a response similar to the one below is returned. In this case, the suggested wait time before initiating the next request is 10 seconds.

HTTP/1.1 429 Too Many Requests
retry-after: 10