Call the Experimentation Assignment API
Use the Experimentation Assignment API when you deliver personalization through a custom channel — your own app or system, not a built-in connector — and need to know which variant (the test version shown) or control (the no-change baseline) a visitor is in, so your code shows the matching experience consistently on every visit.
Request an assignment
- Obtain an OAuth access token for your connected app.
- Send a
Bearer-authenticated request naming the experiment and the individual. - Read the variant (or control) name from the response.
- Cache that assignment for the visitor’s session.
- Serve the matching content or logic for the returned variant.
curl -X POST "{{instance_url}}/personalization/experiments/assignment" \
-H "Authorization: Bearer {{access_token}}" \
-H "Content-Type: application/json" \
-d '{ "experimentId": "{{experiment_id}}", "individualId": "{{individual_id}}" }' {
"experimentId": "{{experiment_id}}",
"individualId": "{{individual_id}}",
"variant": "{{variant_name}}"
}
Discussion
Comments are not configured for local development. They appear once the site owner connects GitHub Discussions (Giscus).