Evaluation REST API
The Amplitude Experiment Evaluation REST API lets you retrieve variant assignment data for users via remote evaluation. User information is passed as query parameters on the request to allow for caching the response on the CDN.
The REST API authenticates the request using your deployment key set in the Authorization header with the prefix
Api-Key. For example,
Authorization: Api-Key <deployment_key>
||The user's ID.|
||The user's device ID.|
||A specific flag key to get the variant of. If empty/missing, all flags & experiments associated with the deployment key are evaluated.|
||JSON string consisting of a full user context. Set user properties in the
A successful request returns a
200 response and a map of flag key to variants. If
flag_key isn't provided, all flags associated with the deployment key in the authorization header are evaluated.
The response body is a JSON object keyed by the flag key. The value for a given flag key is the variant which was assigned to the user. The variant contains its identification
key (a.k.a value) and an optional payload containing a JSON element.
Use the example below to try the API from your browser or copy a curl.
400 Bad Request¶
If the request has invalid JSON in the context parameter, it returns a
If the request doesn't include a valid API key, it returns a
Set the fields in the table, and press send to send the request in browser, or copy the curl to send the request yourself.
Potential data changes
This example makes real requests to the API and can potentially change the data in your Amplitude project. We recommend using a development project when testing APIs.
curl --request GET \ --url 'https://api.lab.amplitude.com/v1/vardata?' \ --header 'Authorization: Api-Key '
|(Required) The deployment key.|
|The user's ID.|
|The user's device ID.|
|A specific flag key to get the variant of. If empty/missing, all flags & experiments associated with the deployment key are evaluated.|
|JSON string consisting of a full user context. Set user properties in the