Object containing filtering rules which will evaluate against context object. Filter can be an instance of 5 different filter types described below.
Filter Schema
Attribute
Type
Desription
type
group
Filter group will evaluate by applying a logical operation to the array of filters provided
filters
Filter[]
Array of filters
operator
enum(and, or)
Logical operation
Attribute
Type
Desription
type
negation
Negation filter is used to negate the evaluation result of the underlying filters.
filter
Filter
Filter object to be negated
Attribute
Type
Desription
type
context
field
string
Refers to a field of the context object.
Example: company.tier
values
string[]
Array of values which will be compared with the value of the context field. Operators SET, NOT_SET, IS_TRUE, IS_FALSE require 0 values, ANY_OF and NOT_ANY_OF support multiple values. All the other operators require exactly one value.
Operator for comparison of the context field with provided values.
Attribute
Type
Desription
type
rolloutPercentage
Rollout percentage filter is used for gradual rollouts. It evaluates to true or false proportionally based on the rollout threshold provided. Bucket evaluates the filter by calculating a numeric hash from the rollout attribute. Contexts of which hash is under the threshold provided will evaluate to true.
partialRolloutAttribute
company.id
Currently only "company.id" is supported.
partialRolloutThreshold
number
Number from 0 to 10000 where 0 means no one will have access and 10000 means everyone will have access.
Attribute
Type
Desription
type
constant
Filter constant will evaluate to the value provided. This is expected when the feature is enabled either for everyone or no one.
Use this endpoint to get the list of all features with their targeting rules.
GEThttps://front.bucket.co/features
Authorization
Response
OK
Body
success*enum
Indicates if the request was successful
true
featuresarray of FeatureWithTargeting (object)
Request
Response
Features enabled
Use this endpoint to get the list of enabled features for the user. The response will contain the list of features that are enabled for the user.
GEThttps://front.bucket.co/features/enabled
Authorization
Query parameters
Response
OK
Body
success*enum
Indicates if the request was successful
true
features*FeaturesMap (object)
remoteContextUsed*boolean
Indicates if the remote context was used
Request
Response
Features evaluated
Use this endpoint to get the list of all features evaluated for the user.
GEThttps://front.bucket.co/features/evaluated
Authorization
Query parameters
Response
OK
Body
success*enum
Indicates if the request was successful
true
features*FeaturesMap (object)
remoteContextUsed*boolean
Indicates if the remote context was used
Request
Response
Features events
Use this endpoint to send feature events to Bucket.
POSThttps://front.bucket.co/features/events
Authorization
Body
actionenum
evaluatecheck
keyfeatureKey (string)
Feature key - unique identifier of the feature which you can find in app.bucket.co
Example:
new-order-created
targetingVersiontargetingVersion (number)
The version of the targeting rules. Every time when targeting rules are updated the version is incremented.
evalContextflagEvaluationContext (object)
Context object has to be flattened and delimited by dots and provided as query parameters.
Example:
context.company.id=42&context.user.id=99
evalResultboolean
The result of the evaluation
evalRuleResultsarray of boolean
The results of evaluation for each of the rules
evalMissingFieldsarray of string
The fields that were missing in the context for successful evaluation
Response
OK
Body
success*enum
Indicates if the request was successful
true
Request
Response
User
Use this endpoint when you want to send user attributes to Bucket. If the user does not exist, it will be created. This endpoint is also used whenever you construct bucket client in any of the SDKs.
Number (milliseconds since epoch) or an ISO-8601 datetime string
Example:
2021-01-01T13:37:00.000Z
Defaults to current time if not provided
Response
OK
Body
success*enum
Indicates if the request was successful
true
Request
Response
Company
Use this endpoint when you want to send company attributes to Bucket. If the company does not exist, it will be created. You can also use this endpoint to assign user to a company by including the user ID. This endpoint is also used whenever you construct bucket client in any of the SDKs.