---
title: "Conclude Experiment"
method: POST
path: "/core/experiments/{id}/conclude"
tags: ["Experiments"]
---

# Conclude Experiment

`POST /core/experiments/{id}/conclude`

## Request

- Base URL: `https://api.anyreach.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.anyreach.ai/core/experiments/{id}/conclude`
- Auth: HTTP bearer

End the experiment and keep one variant.

Keeping `control` changes no widget. Keeping another variant writes its
overlay into every widget in the experiment, and its agent version if it
swaps one, in one transaction. A widget that follows a preset section the
winner changes stops following it, or the preset would undo the change.

## Path parameters

- `id` string, required

## Headers

- `x-anyreach-org` string, nullable: Organization ID for user PATs (pat_ prefix tokens)

## Request body

- ConcludeRequest
  - `winner_key` string, required: The variant to keep. Anything but `control` is written into every widget in the experiment.
  - `dry_run` boolean: Report what would change, write nothing.

## Response `200`

Successful Response

- ConcludeResponse
  - `concluded` boolean, required
  - `experiment` ExperimentOut, required: An experiment, plus what its variants change, for the editors.
    - `id` string, required
    - `organization_id` string, required
    - `name` string, required
    - `hypothesis` string
    - `unit` string
    - `status` 'draft' | 'running' | 'paused' | 'concluded', required
    - `salt` string, required
    - `variants` ExperimentVariant[], required
      - `key` string, required
      - `name` string
      - `weight` integer, required
      - `overlay` object
    - `primary_metric` string, nullable
    - `started_at` string, date-time, nullable
    - `ended_at` string, date-time, nullable
    - `winner_key` string, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `created_by` string, nullable
    - `modified_by` string, nullable
    - `scopes` ExperimentScope[]
      - `scope_type` 'web_widget' | 'phone_number' | 'email_address' | 'agent', required
      - `scope_id` string, required
      - `active` boolean
    - `touched_sections` string[]
    - `swaps_agent_version` boolean
    - `metric_options` string[]
  - `widgets` ConcludedWidget[], required
    - `widget_id` string, required
    - `unlinked_sections` string[]
    - `agent_version_id` string, nullable

## Other responses

- `422`: Validation Error

---

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