# PATCH /ab-tests/:test_id

**Resource:** [AB_TESTS](./ab-tests.md)  
**MCP tool:** `update_ab_test`  
**Scopes:** `ab-tests:write`  
**Write operation:** yes

Change an A/B test's settings, or start, pause or resume it with status. Starting needs at least two versions, and is refused (409) when the agent already has a running test. Pausing keeps leads in the versions they have and gives new leads the control version. To finish a test use promote_ab_test_winner.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `test_id` | path | string | yes | The A/B test id. |
| `name` | body | string | no | What is being tested, e.g. "Reawakening opener: price vs no price". |
| `description` | body | string | no | Optional notes on the idea behind the test. |
| `goal` | body | string | no | What decides the winner. replied (an inbound email, text or call), booked (a booking), won (an opportunity won), became_lead (a new opportunity; for a website visitor, one carrying their visitor id), opened (an email blast opened, or an email an automation or Auto Sequence in the test sent through TrustPager Email), clicked (a link in an email blast), paid (an invoice paid in full), reviewed (a review from their email address), signed (a document signed). Default depends on what is tested: booked for agents and sequences, clicked for blasts, became_lead for websites, forms and lead magnets, signed for quote templates, paid for invoice reminders, reviewed for review requests. |
| `winner_mode` | body | string | no | "approval" (default): the winner is shown and a person promotes it. "auto": the winner takes over by itself once it is clear. |
| `min_leads_per_version` | body | number | no | Leads every version needs before a winner can be called. Default 30. |
| `confidence_needed` | body | number | no | How sure (0.5 to 0.999) the test must be before calling a winner. Default 0.95. |
| `attribution_days` | body | number | no | Days after a lead is put into a version during which their reply, booking, sale or opt-out counts. Default 30. |
| `status` | body | string | no | "running" starts a draft test or resumes a paused one. "paused" stops putting new leads into versions; leads already in keep theirs. To finish a test, use promote_ab_test_winner. |
| `subject_type` | body | string | no | Change what is being tested (draft tests only). |
| `subject_id` | body | string | no | Change what is being tested (draft tests only). |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X PATCH   "https://api.trustpager.com/functions/v1/api/v1/ab-tests/:test_id"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","description":"...","goal":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`