> ## Documentation Index
> Fetch the complete documentation index at: https://docs.walead.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Variant

> Updates a message variant's content, enabled status, or ICP definition

## Overview

Updates a message variant's content, enabled status, or ICP targeting configuration. This allows you to refine your messaging and A/B test different approaches.

## Updatable Fields

### body

The message template content. Supports WaLead variables and can be up to 8000 characters.

**Example**:

```json theme={null}
{
  "body": "Hi {{firstName}},\n\nI noticed you're working on {{companyName}}'s growth..."
}
```

### isDisabled

Whether this variant should be used in the rotation. Disabled variants are skipped when assigning messages to leads.

**Example**:

```json theme={null}
{
  "isDisabled": true
}
```

<Warning>
  You cannot disable the last enabled variant in a step. At least one variant must remain active.
</Warning>

### icpDefinitionRaw

ICP (Ideal Customer Profile) definition that determines which leads receive this variant. Allows for sophisticated targeting based on lead attributes.

**Example**:

```json theme={null}
{
  "icpDefinitionRaw": "C-level executives at companies with 50-200 employees in the SaaS industry"
}
```

## Template Variables

The message body supports these variable types:

**Core Variables** (from the lead profile):

* `{{firstName}}`, `{{lastName}}`, `{{name}}`
* `{{companyName}}`, `{{headline}}`, `{{website}}`
* `{{email}}`, `{{phone}}`

**Custom Variables** (defined per lead):

* Any custom fields you've added to your leads
* Example: `{{industry}}`, `{{location}}`, `{{painPoint}}`

## Character Limit

The `body` field has a maximum length of 8000 characters to ensure deliverability and comply with LinkedIn's message limits.

## A/B Testing Strategy

<Tip>
  When updating variants for A/B testing:

  1. Let each variant run for at least 100 leads before analyzing results
  2. Only change one element at a time (message hook, CTA, length, etc.)
  3. Use the campaign analytics to compare variant performance
</Tip>

## Response

Returns the updated array of all variants for the step, allowing you to see the changes in context.

## Use Cases

* Refine message copy based on response rates
* Temporarily disable underperforming variants
* Apply different messages to different ICP segments
* Update personalization variables as you gather more lead data


## OpenAPI

````yaml PUT /v1/campaigns/{id}/steps/{stepId}/variants/{variantId}
openapi: 3.1.0
info:
  title: WaLead API
  description: >-
    WaLead Public API for managing LinkedIn outreach campaigns, leads, and
    analytics
  version: 1.0.0
  contact:
    name: WaLead Support
    url: https://walead.ai
servers:
  - url: https://app-api.walead.ai/api
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /v1/campaigns/{id}/steps/{stepId}/variants/{variantId}:
    put:
      summary: Update Variant
      description: Updates a message variant's content, enabled status, or ICP definition
      parameters:
        - name: id
          in: path
          description: Campaign ID
          required: true
          schema:
            type: string
        - name: stepId
          in: path
          description: Step ID
          required: true
          schema:
            type: string
        - name: variantId
          in: path
          description: Variant ID
          required: true
          schema:
            type: string
      requestBody:
        description: Variant update data
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                body:
                  type: string
                  maxLength: 8000
                  description: Message template body
                isDisabled:
                  type: boolean
                  description: Whether this variant is disabled
                icpDefinitionRaw:
                  type: string
                  description: ICP (Ideal Customer Profile) definition for targeting
      responses:
        '200':
          description: Variant updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  variants:
                    type: array
                    items:
                      $ref: '#/components/schemas/StepVariant'
        '400':
          description: Bad request - Invalid data or cannot disable last variant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid API Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Campaign, step, or variant not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    StepVariant:
      type: object
      properties:
        id:
          type: string
          description: Unique variant identifier
        body:
          type: string
          description: Message template content
        order:
          type: integer
          description: Variant order for rotation
        isDisabled:
          type: boolean
          description: Whether this variant is disabled
        icpDefinitionRaw:
          type: string
          nullable: true
          description: ICP (Ideal Customer Profile) definition for targeting
        stepId:
          type: string
          description: Associated step ID
        aiTools:
          type: array
          items:
            $ref: '#/components/schemas/AITool'
          description: AI tools enabled for this variant
    Error:
      type: object
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Error message
    AITool:
      type: object
      properties:
        name:
          type: string
          description: AI tool name
        key:
          type: string
          description: AI tool unique key
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Generate from your WaLead dashboard.

````