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.
https://api.statsig.com/v1/check_gateAuthorizations
statsig-api-keystringrequiredapiKey (header)
Body
application/jsongateNamestringSingle gate name to check (use this OR gateNames, not both)
min length: 2max length: 100pattern: ^[a-zA-Z0-9_\-. ]+$gateNamesstring[]Array of gate names to check (use this OR gateName, not both)
userobjectUser object containing identification and attributes for evaluation. At minimum, provide at least one identifier.
Show child attributes
userIDstringPrimary user identifier
user-123emailstringUser email address
user@example.comformat: emailipstringUser IP address for geo-targeting
192.168.1.1userAgentstringUser agent string for device/browser targeting
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36countrystring2-letter country code (ISO 3166-1 alpha-2)
USlocalestringLocale/language code
en_USappVersionstringApplication version
1.2.3customobjectCustom user attributes for targeting (string, number, boolean, or array of strings)
{"subscription_plan":"premium","account_age_days":45,"is_beta_tester":true}privateAttributesobjectPrivate attributes used for evaluation but not logged to analytics
{"internal_user_id":"12345"}customIDsobjectAdditional custom identifier mappings
{"companyID":"company-456","deviceID":"device-789"}statsigEnvironmentobjectEnvironment tier for targeting
tierstringEnvironment tier
productionstagingdevelopmentstatsigMetadataobjectSDK metadata for tracking SDK type, version, and other diagnostic information
{"sdkType":"js-client","sdkVersion":"4.20.0","exposureLoggingDisabled":false}Show child attributes
sdkTypestringSDK type sending the request (e.g., js-client)
sdkVersionstringSDK version
exposureLoggingDisabledbooleanWhen true, prevents the HTTP API from automatically logging exposures. Use this only if you will handle exposure logging yourself.
Response
application/jsonnamestringGate name
valuebooleanWhether the gate passes for this user
rule_idstringID of the rule that matched (null if gate failed)
nullablegroup_namestringName of the matching group (null if gate failed)
nullableWas this helpful?