An experiment's exposures in one environment
const url = 'https://example.com/api/v1/projects/example/experiments/example/exposures?environment=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/v1/projects/example/experiments/example/exposures?environment=example' \ --header 'Authorization: Bearer <token>'What the exposures of an experiment of any status came to in one
environment, from the exposure rollup, which reads the exposures
committed every 10 seconds; as_of is when it last moved, null
before it first did.
A unit’s first exposure is its non-override exposure with the
earliest occurred_at, ties broken by the smaller event_id; an
earlier exposure arriving late replaces it. Every other
non-override exposure of the unit naming another variation is a
conflict. Override exposures are counted as overridden and never
make, replace or conflict with a first exposure. However exposures
arrive, in whatever order and batches, the counts come out the
same.
variations lists the experiment’s variations in its order, each
even without an exposure, then any other variation an override
exposure named, by key, which expects no share. rejections
counts the exposures of the experiment refused in the environment,
by reason.
sample_ratio is the latest sample-ratio check of the experiment in
the environment, null before the first. Every 10 minutes, and when it
stops, each running experiment is checked in each
environment holding its rule: with N its first exposures over the
variations it weighs, O a variation’s first exposures and
E = N × weight / 10000, X² = Σ (O − E)² / E at one degree of
freedom fewer than variations, and p_value is its chi-square upper
tail. Below 1,000 first exposures (below_minimum_sample) or with a
variation expecting fewer than 5 (expected_below_5) the check is
skipped and leaves any alert as it is. An srm alert is raised at
p_value below 0.001 and cleared above 0.01; between the two it
stays as it is. The stop takes a check at its time, with final
false, since exposures accepted before the stop may not have been
rolled up yet; once they have, the next round takes the final check
over every exposure received at or before the stop, final true and
checked_at that round’s time, and nothing replaces it. For example,
weights 5,000/5,000 and 5,200/4,800 first exposures give X² 16 and
p_value about 0.000063: an alert.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The project’s key.
The experiment’s key.
Query Parameters
Section titled “Query Parameters”The key of the environment whose exposures to read.
Responses
Section titled “Responses”The experiment’s exposures in the environment. A sink’s exported rows reproduce them with the SQL recipe in Exported events.
object
object
The non-override exposures naming the variation.
The override exposures naming the variation.
The units whose first exposure names the variation.
The variation’s share of first exposures, 0 without any.
The share the variation’s weight asks for, 0 for a variation the experiment does not weigh.
object
The exposures naming another variation than their unit’s first exposure.
The units with at least one conflict.
The exposures refused, by reason, those with a count only.
object
The rejection code, such as unknown_variation.
When the exposure rollup last moved; null before it first did.
The latest sample-ratio check in the environment; null before the first.
object
The first exposures of the variations the experiment weighs.
X²; null when the check was skipped.
The chi-square upper tail of X²; null when the check was skipped.
Why the check computed no statistic; null when it did.
An srm alert is active in the environment, acknowledged or not.
When the check ran; a stopped experiment’s is its stop until the final check replaces it.
Whether this is the result the experiment keeps. Every result of a running experiment is final. The
stop takes its own result at its time, not final, since exposures accepted before the stop may not
have been rolled up yet; once the exposure rollup has read every exposure received at or before the
stop, the next round of the checks takes the final one over exactly those exposures, with
checked_at the round’s time. Nothing replaces a final result.
Example
{ "sample_ratio": { "skipped_reason": "below_minimum_sample" }}invalid_request: a parameter that is malformed or out of its range, such as a cursor this API did not return.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).
Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "retry_after": 1, "permission": "example", "current_version": 1, "references": [ { "kind": "example", "key": "example", "environment": "example" } ], "provider": "example", "used_by": [ "example" ], "failure": "example", "failure_status": 1, "failure_code": "example", "errors": [ { "pointer": "example", "code": "example", "detail": "example", "params": {} } ]}No credential, or one that is not accepted: unauthenticated without
a credential (a session cookie the server did not issue counts as
none); invalid_token, token_revoked or token_expired for an API
token, with a WWW-Authenticate header naming the code;
session_expired for a session that has ended, whose cookie is
cleared; invalid_credentials for a sign-in.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).
Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "retry_after": 1, "permission": "example", "current_version": 1, "references": [ { "kind": "example", "key": "example", "environment": "example" } ], "provider": "example", "used_by": [ "example" ], "failure": "example", "failure_status": 1, "failure_code": "example", "errors": [ { "pointer": "example", "code": "example", "detail": "example", "params": {} } ]}Headers
Section titled “Headers”The caller may not perform the operation: forbidden (with the
missing permission), session_required, insufficient_scope,
cross_origin for a request signed in by the session cookie, a read
included, that the browser says comes from another origin, or, for a
write, change_request_required when it would change what a
protected environment’s SDKs receive; detail names those
environments.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).
Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "retry_after": 1, "permission": "example", "current_version": 1, "references": [ { "kind": "example", "key": "example", "environment": "example" } ], "provider": "example", "used_by": [ "example" ], "failure": "example", "failure_status": 1, "failure_code": "example", "errors": [ { "pointer": "example", "code": "example", "detail": "example", "params": {} } ]}not_found: no such project, or nothing under that identifier in it. An unknown project is answered before any permission is judged.
A problem document (RFC 9457). Code-specific values are further members.
object
Stable snake_case name of the problem, which clients branch on.
An English explanation for humans; never what a client branches on.
Seconds to wait before retrying, for a rate limit.
The permission the caller lacks, for forbidden, or the role’s permission the caller lacks, for role_not_allowed.
The version the entity has now, for version_mismatch.
What still names what the write would remove or hide, for in_use.
object
What names it, such as flag, segment or experiment.
The key of the environment it is named in; null when it is named in every environment.
The slug of the auth provider to sign in through instead, for sso_required.
What keeps an auth provider from being deleted, disabled or edited, for provider_in_use, such as identities, enforced domains or only way in (the only enabled provider while local login is disabled).
Why a system the server asked did not answer as needed, for provider_unreachable; for sink_not_ready the failure class of the target’s check, such as connect or status.
The HTTP status the target answered, for sink_not_ready, when it answered.
The target’s own error code, for sink_not_ready, when it speaks one, such as a ClickHouse exception or an S3 error code.
object
JSON Pointer into the request body.
The values of the rule broken, such as the bounds of a length, for a client to explain the violation in its own language.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "retry_after": 1, "permission": "example", "current_version": 1, "references": [ { "kind": "example", "key": "example", "environment": "example" } ], "provider": "example", "used_by": [ "example" ], "failure": "example", "failure_status": 1, "failure_code": "example", "errors": [ { "pointer": "example", "code": "example", "detail": "example", "params": {} } ]}