Check Feature Gate(s)

Evaluates one or more feature gates for a user and returns pass/fail results. Automatically logs exposure events for analytics.

Evaluates one or more feature gates for a user and returns pass/fail results. Automatically logs exposure events for analytics.

posthttps://api.statsig.com/v1/check_gate

Authorizations

statsig-api-keystringrequired

apiKey (header)

Body

application/json
gateNamestring

Single gate name to check (use this OR gateNames, not both)

Constraints:min length: 2max length: 100pattern: ^[a-zA-Z0-9_\-. ]+$
gateNamesstring[]

Array of gate names to check (use this OR gateName, not both)

userobject

User object containing identification and attributes for evaluation. At minimum, provide at least one identifier.

Show child attributes
userIDstring

Primary user identifier

Example:user-123
emailstring

User email address

Example:user@example.com
Constraints:format: email
ipstring

User IP address for geo-targeting

Example:192.168.1.1
userAgentstring

User agent string for device/browser targeting

Example:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
countrystring

2-letter country code (ISO 3166-1 alpha-2)

Example:US
localestring

Locale/language code

Example:en_US
appVersionstring

Application version

Example:1.2.3
customobject

Custom user attributes for targeting (string, number, boolean, or array of strings)

Example:{"subscription_plan":"premium","account_age_days":45,"is_beta_tester":true}
privateAttributesobject

Private attributes used for evaluation but not logged to analytics

Example:{"internal_user_id":"12345"}
customIDsobject

Additional custom identifier mappings

Example:{"companyID":"company-456","deviceID":"device-789"}
statsigEnvironmentobject

Environment tier for targeting

tierstring

Environment tier

Allowed values:productionstagingdevelopment
statsigMetadataobject

SDK metadata for tracking SDK type, version, and other diagnostic information

Example:{"sdkType":"js-client","sdkVersion":"4.20.0","exposureLoggingDisabled":false}
Show child attributes
sdkTypestring

SDK type sending the request (e.g., js-client)

sdkVersionstring

SDK version

exposureLoggingDisabledboolean

When true, prevents the HTTP API from automatically logging exposures. Use this only if you will handle exposure logging yourself.

Response

application/json
200· Gate evaluation result(s)
namestring

Gate name

valueboolean

Whether the gate passes for this user

rule_idstring

ID of the rule that matched (null if gate failed)

Constraints:nullable
group_namestring

Name of the matching group (null if gate failed)

Constraints:nullable

Was this helpful?