# POST /ab-tests/pick

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

The version a person should get, for anything about to message, call or show them something. Sticky: the first pick is random (by weight) and recorded, and every later pick for that person returns the same version, so nobody sees both. Give contact_id for a known lead, visitor_id for an anonymous website visitor, or both once a visitor becomes a lead (they keep their version). Give test_id, or subject_type plus subject_id to use whichever test that thing is in (returns version null when it is in none: use the normal wording). When the test is paused, anyone new gets the control version and is not counted; when finished, everyone gets the winner.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `contact_id` | body | string | no | The lead (contact id) about to be messaged, called or shown something. Give this, visitor_id, or both. |
| `visitor_id` | body | string | no | An anonymous website visitor id (the visitor id the TrustPager embed code sets). Give both ids once a visitor becomes a lead, and they keep their version. |
| `deal_id` | body | string | no | Their opportunity id, if any. Bookings, sales and signatures on it count toward the test. |
| `test_id` | body | string | no | The test. Or give subject_type and subject_id to use whichever test that thing is in. |
| `subject_type` | body | string | no | What is being tested, with subject_id, instead of test_id. |
| `subject_id` | body | string | no | Its id, with subject_type, instead of test_id. |
| `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 POST   "https://api.trustpager.com/functions/v1/api/v1/ab-tests/pick"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"contact_id":"...","visitor_id":"...","deal_id":"..."}'
```

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