# Update Sequence Variant

> Change an A/B variant. The campaign must not be active.

Requires an API key with the `write` scope.

Only the fields you send change.

## Path Parameters

<ParamField path="campaign_id" type="string" required>The campaign.</ParamField>
<ParamField path="sequence_id" type="string" required>The sequence step.</ParamField>
<ParamField path="variant_id" type="string" required>The variant.</ParamField>

## Body Parameters

<ParamField body="subject" type="string">Subject line, up to 500 characters.</ParamField>
<ParamField body="body" type="string">Body, up to 200,000 characters.</ParamField>
<ParamField body="label" type="string">Unique within the step, up to 10 characters.</ParamField>
<ParamField body="weight" type="integer">1 to 1000.</ParamField>
<ParamField body="sendAsHtml" type="boolean">Send as HTML.</ParamField>

## Response

<ResponseField name="data" type="object">
  <Expandable title="Variant object">
    <ResponseField name="id" type="string">Variant identifier.</ResponseField>
    <ResponseField name="sequenceId" type="string">The step it belongs to.</ResponseField>
    <ResponseField name="label" type="string">Unique within the step, for example `A`.</ResponseField>
    <ResponseField name="subject" type="string">Subject line. Supports variables and spin syntax.</ResponseField>
    <ResponseField name="body" type="string">Body. Supports variables and spin syntax.</ResponseField>
    <ResponseField name="weight" type="integer">Share of sends relative to the other variants.</ResponseField>
    <ResponseField name="sendAsHtml" type="boolean">Sent as HTML.</ResponseField>
    <ResponseField name="createdAt" type="string">ISO 8601 timestamp.</ResponseField>
    <ResponseField name="updatedAt" type="string">ISO 8601 timestamp.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
```bash cURL
curl -X PATCH "https://api.foxreach.io/api/v1/campaigns/cmcamp1/sequences/cmseq1/variants/cmvar1" \
  -H "X-API-Key: otr_your_key" \
  -H "Content-Type: application/json" \
  -d '{"weight": 2}'
```

```python Python SDK
from foxreach import FoxReach

client = FoxReach(api_key="otr_your_key")
from foxreach import VariantUpdate

variant = client.campaigns.sequences.update_variant("cmcamp1", "cmseq1", "cmvar1", VariantUpdate(weight=2))
```

```typescript TypeScript SDK
import { FoxReach } from "foxreach";

const client = new FoxReach({ apiKey: "otr_your_key" });
const variant = await client.campaigns.sequences.updateVariant("cmcamp1", "cmseq1", "cmvar1", { weight: 2 });
```
</RequestExample>

<ResponseExample>
```json
{
  "data": {
    "id": "cmvar1",
    "sequenceId": "cmseq1",
    "label": "B",
    "subject": "Quick idea for {{company}}",
    "body": "Hi {{firstName}}, ...",
    "weight": 1,
    "sendAsHtml": false,
    "createdAt": "2026-11-04T09:00:00",
    "updatedAt": "2026-11-04T09:00:00"
  }
}
```
</ResponseExample>

## Errors

| Status | Description |
|--------|-------------|
| `401` | Missing, invalid, revoked or expired API key |
| `403` | API key does not have the required scope: `write` |
| `400` | The campaign is active (pause it first), the spin syntax is invalid, or the label is already used on this step |
| `404` | Campaign, sequence step or variant not found in this workspace |

## Rate Limit

- **120 requests per minute, shared by every `write` call in your workspace.** Fixed 60-second window.
- Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (unix epoch seconds) and `X-RateLimit-Bucket` (`write`).
- A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns (`Retry-After`, exponential backoff, monitoring `X-RateLimit-Remaining`), see [Rate Limiting](/rate-limiting).
