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

# Bulk Pause or Resume Leads

> Pause or resume up to 100 leads of one campaign in a single call

Pauses or resumes many leads of one campaign with one request, instead of one request per lead. Each lead is handled exactly as [Pause Lead](https://api.smartlead.ai/api-reference/leads/pause.md) or [Resume Lead](https://api.smartlead.ai/api-reference/leads/resume.md) would handle it, one after another, and the response tells you which leads were updated and which failed.

> [!NOTE]
>
> A lead that fails does not stop the others. Once the request body is valid the call returns `200`; check `ok` and the `failed` list rather than the HTTP status alone.

## Path Parameters

**campaign\_id** `number` *required*

The campaign ID containing the leads (positive whole number)

## Query Parameters

**api\_key** `string` *required*

Your SmartLead API key

## Request Body

**action** `string` *required*

What to do with every lead in `lead_ids`: `pause` or `resume` (lower case).

**lead\_ids** `array` *required*

Lead ids (positive integers, no duplicates), 1 to 100. For more leads, send several requests.

**resume\_lead\_with\_delay\_days** `number`

Used by `resume` only; ignored by `pause`. Number of days (0 or more) to wait before sending the next email, applied to every lead in the request. If omitted or `null`, each lead uses the default delay from the sequence configuration. The next email timestamp is calculated as `last_sent_time + delay_days`.

```bash cURL (pause) theme={null}
curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/leads-bulk-action?api_key=YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action": "pause", "lead_ids": [5001, 5002, 5003]}'
```

```bash cURL (resume) theme={null}
curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/leads-bulk-action?api_key=YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action": "resume", "lead_ids": [5001, 5002, 5003], "resume_lead_with_delay_days": 3}'
```

```python Python theme={null}
import requests

API_KEY = "YOUR_API_KEY"
campaign_id = 123
lead_ids = [5001, 5002, 5003]  # any number of leads

# Pause in batches of 100 (the per-request maximum)
for start in range(0, len(lead_ids), 100):
    response = requests.post(
        f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/leads-bulk-action",
        params={"api_key": API_KEY},
        json={"action": "pause", "lead_ids": lead_ids[start:start + 100]},
    )
    result = response.json()
    print(f"Paused {len(result['updated'])} leads, {len(result['failed'])} failed")

# Resume the same leads later, with the default sequence delay
response = requests.post(
    f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/leads-bulk-action",
    params={"api_key": API_KEY},
    json={"action": "resume", "lead_ids": lead_ids[:100]},
)
result = response.json()
for failure in result["failed"]:
    print(f"Lead {failure['lead_id']} not resumed: {failure['error']}")
```

```javascript JavaScript theme={null}
const API_KEY = 'YOUR_API_KEY';
const campaignId = 123;
const leadIds = [5001, 5002, 5003]; // any number of leads

const bulkAction = async (action, ids, extra = {}) => {
  const response = await fetch(
    `https://server.smartlead.ai/api/v1/campaigns/${campaignId}/leads-bulk-action?api_key=${API_KEY}`,
    {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ action, lead_ids: ids, ...extra })
    }
  );
  return response.json();
};

// Pause in batches of 100 (the per-request maximum)
for (let start = 0; start < leadIds.length; start += 100) {
  const result = await bulkAction('pause', leadIds.slice(start, start + 100));
  console.log(`Paused ${result.updated.length} leads, ${result.failed.length} failed`);
}

// Resume later with a 3 day delay
const result = await bulkAction('resume', leadIds.slice(0, 100), { resume_lead_with_delay_days: 3 });
result.failed.forEach((failure) => console.log(`Lead ${failure.lead_id} not resumed: ${failure.error}`));
```

## Response Fields

**ok** `boolean`

`true` when every lead was updated; `false` when at least one lead is in `failed`.

**action** `string`

The action you sent: `pause` or `resume`.

**updated** `array`

The lead ids that were paused or resumed, in the order you sent them.

**failed** `array`

One entry per lead that was not updated.

**failed entry**

**lead\_id** `number`

The lead id that failed.

**status\_code** `number`

The status code the one-lead endpoint returns for this failure (for example `404`, `409` or `500`).

**error** `string`

The error text the one-lead endpoint returns for this failure. For an unexpected error (`status_code` `500` with no `code`) it is the fixed text `Failed to pause lead` or `Failed to resume lead`.

**code** `string`

Present on some `resume` failures: `LAST_SEQUENCE` (the lead is at the last sequence step and cannot be resumed) or `LEAD_NOT_IN_CAMPAIGN` (the lead is not in this campaign). Do not retry these.

## Response Codes

**200** `Success`

The request was processed. Check `ok`, `updated` and `failed` for the result per lead.

**400** `Bad Request`

The request is not valid: `action` is missing or not `pause` / `resume`, `lead_ids` is missing, empty, has more than 100 ids, has duplicates or ids that are not positive integers, `resume_lead_with_delay_days` is negative or not a number, or the body has an unknown key. Nothing is changed.

**401** `Unauthorized`

Invalid or missing API key

**500** `Internal Server Error`

The request as a whole failed unexpectedly. Some leads may already have been updated; check them with [Get Campaign Leads](https://api.smartlead.ai/api-reference/leads/get-by-campaign.md) before retrying.

```json 200 - All leads updated theme={null}
{
  "ok": true,
  "action": "pause",
  "updated": [5001, 5002, 5003],
  "failed": []
}
```

```json 200 - Some leads failed (resume) theme={null}
{
  "ok": false,
  "action": "resume",
  "updated": [5001],
  "failed": [
    {
      "lead_id": 5002,
      "status_code": 409,
      "error": "This is the last sequence. You cannot resume this lead.",
      "code": "LAST_SEQUENCE"
    },
    {
      "lead_id": 5003,
      "status_code": 500,
      "error": "Invalid lead id!",
      "code": "LEAD_NOT_IN_CAMPAIGN"
    }
  ]
}
```

```json 200 - Campaign not found theme={null}
{
  "ok": false,
  "action": "pause",
  "updated": [],
  "failed": [
    {
      "lead_id": 5001,
      "status_code": 404,
      "error": "Campaign not found - Invalid campaign_id."
    }
  ]
}
```

```json 400 - Validation Error theme={null}
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "\"lead_ids\" must contain less than or equal to 100 items",
  "validation": {
    "source": "body",
    "keys": ["lead_ids"]
  }
}
```

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

```json 500 - Server Error theme={null}
{
  "ok": false,
  "error": "Failed to pause or resume leads"
}
```

## Behavior Notes

> [!NOTE]
>
> * Leads are processed one after another in the order you send them, so a request with 100 leads takes longer than a one-lead call. Allow a client timeout of at least 60 seconds.
> * `pause` behaves like [Pause Lead](https://api.smartlead.ai/api-reference/leads/pause.md) for each lead: status changes to `PAUSED`, the next scheduled time is cleared and drafted emails are marked as `STOPPED`.
> * `resume` behaves like [Resume Lead](https://api.smartlead.ai/api-reference/leads/resume.md) for each lead: status changes to `INPROGRESS` and the next email is scheduled from the delay. A lead on the last sequence step cannot be resumed and is returned in `failed`.
> * As with Pause Lead, `pause` does not check that a lead id belongs to the campaign: an id that is not in the campaign changes nothing and is still returned in `updated`. `resume` does check, and returns such an id in `failed` with `LEAD_NOT_IN_CAMPAIGN`.
> * If the campaign does not exist or your API key cannot access it, nothing is changed and every lead is returned in `failed` with `status_code` `404`.
> * One call counts as one request against your [rate limit](https://api.smartlead.ai/guides/rate-limits.md), whatever the number of leads.

## Related Endpoints

* [Pause Lead](https://api.smartlead.ai/api-reference/leads/pause.md)
* [Resume Lead](https://api.smartlead.ai/api-reference/leads/resume.md)
* [Get Campaign Leads](https://api.smartlead.ai/api-reference/leads/get-by-campaign.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.