curl --request POST \
--url https://api.statsig.com/v1/log_custom_exposure \
--header 'Content-Type: application/json' \
--header 'statsig-api-key: <api-key>' \
--data '
{
"exposures": [
{
"user": {
"userID": "user-123"
},
"experimentName": "checkout_flow_v2",
"group": "Test Group",
"ruleID": "rule_abc123",
"secondaryExposures": [
{
"gate": "is_employee",
"gateValue": "false",
"ruleID": "default"
}
]
}
]
}
'{
"success": true
}Manually logs exposure events for experiments or feature gates. Useful for analytics-only experiments, delayed exposure logging, or when automatic exposure logging is disabled.
curl --request POST \
--url https://api.statsig.com/v1/log_custom_exposure \
--header 'Content-Type: application/json' \
--header 'statsig-api-key: <api-key>' \
--data '
{
"exposures": [
{
"user": {
"userID": "user-123"
},
"experimentName": "checkout_flow_v2",
"group": "Test Group",
"ruleID": "rule_abc123",
"secondaryExposures": [
{
"gate": "is_employee",
"gateValue": "false",
"ruleID": "default"
}
]
}
]
}
'{
"success": true
}SDK API key (Server Secret or Client SDK Key)
Array of exposure events to log
1Show child attributes
Name of the experiment or dynamic config
1Group name (use this OR ruleID)
1User object containing identification and attributes for evaluation. At minimum, provide at least one identifier.
Show child attributes
Primary user identifier
"user-123"
User email address
User IP address for geo-targeting
"192.168.1.1"
User agent string for device/browser targeting
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
2-letter country code (ISO 3166-1 alpha-2)
"US"
Locale/language code
"en_US"
Application version
"1.2.3"
Custom user attributes for targeting (string, number, boolean, or array of strings)
{
"subscription_plan": "premium",
"account_age_days": 45,
"is_beta_tester": true
}Private attributes used for evaluation but not logged to analytics
{ "internal_user_id": "12345" }Rule ID (use this OR group)
Exposure timestamp
Shared user object for all exposures
Show child attributes
Primary user identifier
"user-123"
User email address
User IP address for geo-targeting
"192.168.1.1"
User agent string for device/browser targeting
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
2-letter country code (ISO 3166-1 alpha-2)
"US"
Locale/language code
"en_US"
Application version
"1.2.3"
Custom user attributes for targeting (string, number, boolean, or array of strings)
{
"subscription_plan": "premium",
"account_age_days": 45,
"is_beta_tester": true
}Private attributes used for evaluation but not logged to analytics
{ "internal_user_id": "12345" }SDK metadata for tracking SDK type, version, and other diagnostic information
{
"sdkType": "js-client",
"sdkVersion": "4.20.0"
}Exposures accepted for processing
Whether the request was successful
Was this page helpful?