Get Layer Parameters
Fetches parameter values from a layer. Layers allow you to share parameters across multiple experiments. Automatically logs exposure events.
Fetches parameter values from a layer. Layers allow you to share parameters across multiple experiments. Automatically logs exposure events.
https://api.statsig.com/v1/get_layerAuthorizations
statsig-api-keystringrequiredapiKey (header)
Body
application/jsonlayerNamestringrequiredName of the layer
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/jsonnamestringrequiredLayer name
valueobjectrequiredLayer parameter values
ruleIDstringID of the rule that was evaluated
allocatedExperimentNamestringName of the experiment this layer is allocated to (if any)
Was this helpful?