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

# Resubscribe Leads

> Undo an API unsubscribe for up to 100 leads, at account, campaign or client level

Clears the unsubscribe that [Unsubscribe Lead](https://api.smartlead.ai/api-reference/leads/unsubscribe.md) or [Unsubscribe Lead from Campaign](https://api.smartlead.ai/api-reference/campaigns/unsubscribe-lead.md) set, for up to 100 leads in one call. Each lead is either cleared or returned in `skipped` with a reason.

> [!WARNING]
>
> A lead who unsubscribed by clicking an unsubscribe link in one of your emails is **never** resubscribed by this endpoint: it is skipped with the reason `unsubscribed_via_email_link`.

> [!NOTE]
>
> Resubscribing clears the unsubscribe at the level you choose only: a lead that is also unsubscribed at another level (for example on another client) stays unsubscribed there. Campaigns where the lead was already stopped stay stopped; the lead is not added back to any campaign and nothing is sent because of this call.

## Query Parameters

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

Your SmartLead API key

## Request Body

**level** `string` *required*

Where to clear the unsubscribe: `account`, `campaign` or `client`.

* `account`: the unsubscribe on your main account (campaigns without a client). Not available with a client API key.
* `campaign`: the unsubscribe that applies to this campaign, which is its client's when the campaign belongs to a client, otherwise your account's. Requires `campaign_id`.
* `client`: the unsubscribe on one client. Requires `client_id`. A client API key can only use its own client.

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

Lead ids (positive integers, no duplicates), 1 to 100.

**campaign\_id** `number`

Required when `level` is `campaign`; not allowed otherwise.

**client\_id** `number`

Required when `level` is `client`; not allowed otherwise.

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

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

response = requests.post(
    "https://server.smartlead.ai/api/v1/leads/resubscribe",
    params={"api_key": "YOUR_API_KEY"},
    json={"level": "campaign", "campaign_id": 123, "lead_ids": [5001, 5002]},
)
result = response.json()
print("cleared:", result["cleared"])
for item in result["skipped"]:
    print(item["lead_id"], item["reason"])
```

```json 200 theme={null}
{
  "ok": true,
  "level": "account",
  "campaign_id": null,
  "client_id": null,
  "cleared": [5001],
  "skipped": [
    { "lead_id": 5002, "reason": "not_unsubscribed_at_level" },
    { "lead_id": 5003, "reason": "unsubscribed_via_email_link" }
  ]
}
```

```json 404 theme={null}
{
  "ok": false,
  "error": "Campaign not found - Invalid campaign_id."
}
```

```json 500 theme={null}
{
  "ok": false,
  "error": "Failed to resubscribe leads. Please retry."
}
```

## Response Fields

**cleared** `array`

Lead ids whose unsubscribe was cleared at this level

**skipped** `array`

One `{ "lead_id", "reason" }` per lead left unchanged. `reason` is `not_found` (no such lead in your account, or not in that client), `not_unsubscribed_at_level` (the lead is not unsubscribed at this level) or `unsubscribed_via_email_link` (the lead clicked an unsubscribe link; never cleared by the API).

**campaign\_id** `number | null`

The campaign, for `level: "campaign"`; otherwise `null`

**client\_id** `number | null`

The client whose unsubscribe was cleared: the given client, or the campaign's client; `null` for your main account

## Response Codes

**200** `Success`

Done. Read `cleared` and `skipped`: a lead can be skipped even when the call succeeds.

**400** `Bad Request`

Invalid body: unknown `level`, more than 100 or duplicate `lead_ids`, or `campaign_id` / `client_id` missing or sent with the wrong level

**404** `Not Found`

The campaign or client is not yours (`Campaign not found - Invalid campaign_id.`, `Client not found - Invalid client_id.`), or `level: "account"` was used with a client API key (`Account level is not available for client API keys.`)

**429** `Too Many Requests`

More than 10 calls in 60 seconds. See [Rate Limits](https://api.smartlead.ai/guides/rate-limits.md#endpoint-specific-rate-limits).

## Related Endpoints

* [Unsubscribe Lead](https://api.smartlead.ai/api-reference/leads/unsubscribe.md)
* [Unsubscribe Lead from Campaign](https://api.smartlead.ai/api-reference/campaigns/unsubscribe-lead.md)


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