> ## 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.

# Add Step to Campaign

> Adds a new step to the campaign sequence. Step types: invitation, message, visit_profile, screener

## Overview

Adds a new step to a campaign's sequence at a specified position. This automatically reorders existing steps and updates leads already in the campaign to account for the new step.

## Step Types

<AccordionGroup>
  <Accordion title="invitation">
    Sends a LinkedIn connection request to the lead. This is typically the first step in a campaign.
  </Accordion>

  <Accordion title="message">
    Sends a message to the lead. Can be sent to connections or used for InMail. Supports message variants for A/B testing.
  </Accordion>

  <Accordion title="visit_profile">
    Visits the lead's LinkedIn profile to increase visibility.
  </Accordion>

  <Accordion title="screener">
    Sends a qualifying message to determine if the lead is a good fit. Supports AI-powered analysis of responses.
  </Accordion>
</AccordionGroup>

## Request Body

```json theme={null}
{
  "type": "message",
  "order": 2
}
```

The `order` field determines where in the sequence the step will be inserted (0-based index).

## Automatic Handling

When you add a step:

* Existing steps at or after the specified order are shifted down
* Leads already in the campaign have their progress adjusted
* Completed campaigns are reset to "paused" status if new steps are added
* Message and screener steps automatically get a default variant created

## Response

Returns the updated complete array of steps with their IDs, allowing you to immediately reference the new step for adding variants or further configuration.


## OpenAPI

````yaml POST /v1/campaigns/{id}/steps
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:
    post:
      summary: Add Step to Campaign
      description: >-
        Adds a new step to the campaign sequence. Step types: invitation,
        message, visit_profile, screener
      parameters:
        - name: id
          in: path
          description: Campaign ID
          required: true
          schema:
            type: string
      requestBody:
        description: Step details
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - order
              properties:
                type:
                  type: string
                  enum:
                    - invitation
                    - message
                    - visit_profile
                    - screener
                  description: Type of step to add
                order:
                  type: integer
                  description: Position in the sequence (0-based)
      responses:
        '200':
          description: Step added successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  steps:
                    type: array
                    items:
                      $ref: '#/components/schemas/Step'
        '401':
          description: Unauthorized - Invalid API Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Campaign not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Step:
      type: object
      properties:
        id:
          type: string
          description: Unique step identifier
        type:
          type: string
          enum:
            - invitation
            - message
            - visit_profile
            - screener
          description: Step type
        order:
          type: integer
          description: Step position in sequence (0-based)
        delay:
          type: integer
          description: Delay in days before executing this step
        stopOnReply:
          type: boolean
          description: Whether to stop the sequence if lead replies
        genericBody:
          type: string
          nullable: true
          description: Generic message template for the step
        variants:
          type: array
          items:
            $ref: '#/components/schemas/StepVariant'
          description: >-
            Message variants for A/B testing (only for message and screener
            steps)
    Error:
      type: object
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Error message
    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
    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.

````