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

# Push Leads to Campaign

> Push leads from a list or by IDs to a campaign

<Note>
  Move or copy leads into a campaign for outreach. You can push specific leads by ID, all leads from a list, or all leads in your account.
</Note>

## Query Parameters

<ParamField query="api_key" type="string" required>
  Your SmartLead API key
</ParamField>

## Request Body

<ParamField body="campaignId" type="number">
  Target campaign ID. Either `campaignId` or `campaignName` must be provided.
</ParamField>

<ParamField body="campaignName" type="string">
  Target campaign name. If campaign doesn't exist, a new one is created.
</ParamField>

<ParamField body="action" type="string" required>
  Whether to `copy` or `move` leads. Move removes them from the source.
</ParamField>

<ParamField body="leadList" type="object">
  Lead selection criteria
</ParamField>

<ParamField body="leadList.listId" type="number">
  Source list ID to push leads from
</ParamField>

<ParamField body="leadList.leadIds" type="array">
  Specific lead IDs to push. Array of numbers, 1-10,000 items.
</ParamField>

<ParamField body="leadList.allLeads" type="boolean">
  Set to `true` to push all leads. When true, `listId` and `leadIds` should not be provided.
</ParamField>

<ParamField body="csvSettings" type="object">
  Import settings for the campaign (e.g., block list handling)
</ParamField>

<ParamField body="filters" type="object">
  Additional filters to apply when selecting leads
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://server.smartlead.ai/api/v1/leads/push-to-campaign?api_key=YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "campaignId": 12345,
      "action": "copy",
      "leadList": {
        "listId": 500
      }
    }'
  ```
</RequestExample>

## Response Codes

<ResponseField name="200" type="Success">
  Request successful
</ResponseField>

<ResponseField name="400" type="Bad Request">
  Invalid request parameters or malformed request body
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Invalid or missing API key
</ResponseField>

<ResponseField name="422" type="Validation Error">
  Request validation failed. Check parameter types and constraints.
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "ok": true,
    "data": {
      "total_leads": 1250,
      "pushed": 1200,
      "duplicates": 50
    }
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "message": "Invalid API Key"
  }
  ```
</ResponseExample>
