---
title: "Ship a version of an A/B test"
method: POST
path: "/sites/{id}/experiments/{experiment_id}/ship"
tags: ["Sites"]
---

# Ship a version of an A/B test

`POST /sites/{id}/experiments/{experiment_id}/ship`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/sites/{id}/experiments/{experiment_id}/ship`
- Auth: API key in header `Authorization`

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.

## Path parameters

- `id` string, required
- `experiment_id` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `variant` string, required: The key of the version every visitor gets from now on.

## Response `200`

The shipped test

- SiteExperiment
  - `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.
    - `key` string, required
    - `name` string, required
    - `weight` integer, required
  - `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.
    - `verdict` 'collecting' | 'no_clear_winner_yet' | 'winner' | 'sample_ratio_mismatch', required: `collecting` until every version has 50 visitors and 5 buyers (visitors who reached the goal). `winner` once one version has a 95% chance of beating the control, or the control beats every other version. `sample_ratio_mismatch` when visitors are not splitting as the weights say, so the numbers can't be trusted.
    - `winner` string, nullable, required: The winning version's key when `verdict` is `winner`, `control` included.
    - `primary_metric` 'conversion_rate' | 'revenue_per_visitor', required
    - `goal` string, required: What counts as a conversion: `purchase`, or the event name the test was judged on.
    - `summary` string, required: One plain-English sentence for the merchant.
    - `window` object, required
      - `from` string, date-time, required
      - `to` string, date-time, required
      - `truncated` boolean, required: The test started longer ago than visits are kept, so only the most recent days count.
    - `currency` string, required: The currency of `revenue`, in its smallest unit.
    - `sample_ratio_p_value` number, double, nullable, required
    - `variants` object[], required
      - `key` string, required
      - `name` string, required
      - `visitors` integer, required
      - `buyers` integer, required: Visitors who reached the goal after first seeing this version: bought, for a `purchase` goal, or fired the goal event.
      - `orders` integer, required: Orders those visitors placed. 0 unless the goal is `purchase`.
      - `revenue` integer, required: Smallest currency unit. 0 unless the goal is `purchase`.
      - `conversion_rate` number, double, required: Buyers per visitor.
      - `revenue_per_visitor` number, double, required: Smallest currency unit.
      - `vs_control` object, nullable, required: Null for the control, and when the control has nothing to compare against yet.
        - `lift` number, double, required: Relative difference from the control on the primary metric: 0.31 is 31% better.
        - `ci_low` number, double, required
        - `ci_high` number, double, required
        - `chance_to_beat_control` number, double, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `404`: Resource not found
- `422`: Validation error
- `429`: Rate limit exceeded — 600 requests per minute per owner on the free tier: every API key and OAuth token one person holds on an account shares one budget, and the account's team keys share another. Retry after the number of seconds in `Retry-After`.

## Changes

- **2026-11-17** `bb611012cc71`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/crevio/apis/crevio-api-v1/changes/sites/:id/experiments/:experiment_id/ship/post.md)

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) - [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/ccbd8fcbd6d7?raw)
