---
title: "Update A/B test variant"
method: PATCH
path: "/ab-tests/{abTestId}/variants/{variantId}"
tags: ["A/B Tests"]
---

# Update A/B test variant

`PATCH /ab-tests/{abTestId}/variants/{variantId}`

Updates a draft A/B test variant's subject, preview text, or body content.

## Path parameters

- `abTestId` string, required
- `variantId` string, required

## Request body

- object
  - `html` string — Raw HTML body. Provide either html or blocks, not both.
  - `blocks` EmailBlock[] — Structured email blocks. Provide either blocks or html, not both.
    - `id` string
    - `type` 'text' | 'html' | 'heading' | 'list' | 'button' | 'spacer' | 'divider' | 'image' | 'columns' | 'conditional-group' | 'card' | 'cta' | 'social' | 'logo' | 'footer' | 'video' | 'product', required
    - `content` string — Content for text, html, and heading-like blocks.
  - `subject` string
  - `previewText` string, nullable

## Response `200`

Variant updated

- object
  - `success` boolean
  - `variant` ABTestVariant
    - `id` string
    - `variantId` string
    - `abTestId` string
    - `label` string
    - `variantLabel` string
    - `emailId` string
    - `subject` string
    - `previewText` string, nullable
    - `blocks` EmailBlock[]
      - `id` string
      - `type` 'text' | 'html' | 'heading' | 'list' | 'button' | 'spacer' | 'divider' | 'image' | 'columns' | 'conditional-group' | 'card' | 'cta' | 'social' | 'logo' | 'footer' | 'video' | 'product', required
      - `content` string — Content for text, html, and heading-like blocks.
    - `testSends` integer
    - `testOpens` integer
    - `testClicks` integer
    - `isWinner` boolean
    - `localizations` object[]
    - `createdAt` string, date-time

## Other responses

- `400` — Validation error or non-draft A/B test
- `401` — Unauthorized
- `404` — A/B test or variant not found
- `500` — Variant could not be updated

## Changes

- **2026-05-15** `b040bb8c6608` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/sequenzy/apis/sequenzy-api/changes/ab-tests/:abTestId/variants/:variantId/patch.md)

---

[API](https://skmtc.dev/sequenzy/apis/sequenzy-api.md) · [All operations](https://skmtc.dev/sequenzy/apis/sequenzy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sequenzy/sequenzy-api/revisions/b040bb8c6608/schema)
