Skip to main content

Experimentation

Sellable product

This capability is granted by an API key scoped to the `` product (product face). See the product reference below.

Experimentation capability — a durable, org-scoped experiment registry with a DETERMINISTIC variant assignment engine (stable SHA-256 hash of (salt, key, user_id) → a fixed bucket space → sliced by cumulative normalized weight; sticky by construction, no per-user assignment row). Products stop re-rolling an A/B engine + an exposure pipeline; they define experiments, assign users, and record exposures over this one capability. I4: own Postgres store (fleet_experiments); the results SoT is the local exposures table, analytics is a downstream mirror.

  • Group: Governance & platform
  • Contract: contracts/experimentation/v1/openapi.yaml
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/experiments

Endpoints

MethodPathSummary
POST/v1/experimentsDefine (idempotent upsert) an experiment — key, weighted variants, status, metric
GET/v1/experimentsList the org's experiments (newest first)
GET/v1/experiments/&#123;experiment_id&#125;One experiment definition or 404
PATCH/v1/experiments/&#123;experiment_id&#125;Partially update an experiment (name / variants / status / metric)
GET/v1/assignDeterministically assign a user to a variant (sticky; control on not-running / kill-switch)
POST/v1/exposuresRecord a user's exposure (persist to results SoT + fan out to analytics, fail-open)
GET/v1/experiments/&#123;experiment_id&#125;/resultsPer-variant exposure / unique-user readout for the experiment
GET/healthliveness
GET/metricsPrometheus

Schemas

Variant

FieldTypeDescription
namestringvariant name (unique within the experiment; the first is control)
weightnumberrelative weight; normalized across variants (equal split when all omitted)

ExperimentRequest

FieldTypeDescription
organization_idstringproduct-tier end-customer tenant (I6)
experiment_idstringserver-generated (exp_...) if omitted; supply to upsert an existing one
keystringstable human key, unique per org — the /v1/assign lookup handle
namestring
variantsarray
statusstring
metricstringthe primary success metric name (recorded on emitted exposure events)
saltstringper-experiment bucketing salt; server default when omitted. Rotating it re-randomizes assignment — never on a live experiment

ExperimentPatch

FieldTypeDescription
organization_idstring
namestring
variantsarray
statusstring
metricstring

Experiment

FieldTypeDescription
experiment_idstring
keystring
namestring
variantsarray
statusstring
metricstring
saltstring
created_atnumberepoch seconds
updated_atnumber

ExperimentList

FieldTypeDescription
experimentsarray
countinteger

Assignment

FieldTypeDescription
experimentstringthe experiment key
experiment_idstring
variantstringassigned variant name (control when not-running/killed)
stickybooleanalways true — a pure deterministic function of (key, user_id, salt)
reasonstringassigned

ExposureRequest

FieldTypeDescription
organization_idstring
experimentstringexperiment_id or key
user_idstring
variantstringomit → recomputed deterministically server-side

ExposureResult

FieldTypeDescription
experimentstring
experiment_idstring
user_idstring
variantstring
recordedbooleanpersisted to the local exposures SoT
emitted_to_analyticsbooleanfanned out to the analytics capability (fail-open — false on a downstream outage)

Generated by scripts/gen-capability-docs.py from contracts/experimentation/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.