Sites

Ship a version of an A/B test

Changed on

Ends the test and serves variant to every visitor within about a minute, before any code changes. Ship control to just stop the test. The results are frozen as they stand. Then make the shipped version the page's only code, deploy it, and archive the test. Refused with invalid_transition when the test is not in a state this step applies to. Shipping the version already shipped changes nothing.

post/sites/{id}/experiments/{experiment_id}/ship

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Path parameters

id, string required

The resource's ID, as returned in its id field

experiment_id, string required

The test's ID (e.g., "exp_3f9a1c0b7d2e4a6f8b1c3d5e")

Headers

Idempotency-Key, string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Request body

object required
variant, string required

The key of the version every visitor gets from now on.

Response

The shipped test

SiteExperiment required
object, string required
id, string required
site_id, string required
key, string required
name, string required
hypothesis, string nullable required
path, string required
goal, string required
primary_metric, 'conversion_rate' | 'revenue_per_visitor' required
status, 'draft' | 'running' | 'shipped' | 'archived' required
shipped_variant, string nullable required
variants, object[] required

The versions under test. The first is the control and is keyed control; weights are whole percentages of visitors that add up to 100.

started_at, string date-time nullable required
ended_at, string date-time nullable required
results, object nullable required

How each version is doing, from visitors who saw only that version and what they did after first seeing it: the orders they placed for a purchase goal, or whether they fired the goal event. Null in lists, while the test is a draft, and when results are briefly unavailable. Recomputed at most every 5 minutes while running; frozen when the test ships.

created_at, string date-time required
updated_at, string date-time required

Changes