# PATCH /ab-tests/:test_id/versions/:version_id

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

Edit a version. The name can change at any time; its content, weight and control flag only while the test is a draft, so results always describe what leads actually got.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `test_id` | path | string | yes | The A/B test id. |
| `version_id` | path | string | yes | The version id. |
| `name` | body | string | no | Rename the version (allowed at any time). |
| `content` | body | object | no | What this version changes, read by the agent that uses the test. Use the keys the agent reads: "message" (an opening text or email body), "subject" (email subject), "offer" (the offer in words), "greeting" (a voice agent's first line), "instructions" (extra guidance for an AI agent). Example: { "message": "Hi {{contact.first_name}}, ...", "offer": "$129 a seat, free setup" }. For an automation or an Auto Sequence (subject_type automation or auto_queue) this happens on its own, on every email and text it sends to the lead: "subject" and "message" replace each step's own subject and body, and every value can be used in a step's wording as {{ab.<key>}} (e.g. {{ab.offer}}, and {{ab.version}} for the version's name). For a sequence with several emails, put per-step changes under "steps", keyed by the automation action id: { "steps": { "<action id>": { "subject": "...", "message": "..." } } }; these win over the top-level ones. Staff alerts and other fixed-address steps are never changed. Opens are counted for emails sent through TrustPager Email. Draft tests only, so results always describe what leads actually got. |
| `weight` | body | number | no | Change its share of new leads (draft tests only). |
| `is_control` | body | boolean | no | Make this the control version (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/versions/:version_id"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","content":"...","weight":"..."}'
```

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