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

# Unsubscribe Lead Globally

> Globally unsubscribe a lead from all current and future campaigns

<Warning>
  This action unsubscribes the lead globally across all campaigns in your account. The lead will not receive any future emails from any campaign. This action cannot be undone via API.
</Warning>

## Path Parameters

<ParamField path="lead_id" type="number" required>
  The lead ID to unsubscribe globally
</ParamField>

## Query Parameters

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

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://server.smartlead.ai/api/v1/leads/456/unsubscribe?api_key=YOUR_KEY"
  ```

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

  API_KEY = "YOUR_API_KEY"
  lead_id = 456

  response = requests.post(
      f"https://server.smartlead.ai/api/v1/leads/{lead_id}/unsubscribe",
      params={"api_key": API_KEY}
  )

  result = response.json()
  if result.get('ok'):
      print(f"Lead {lead_id} unsubscribed globally")
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'YOUR_API_KEY';
  const leadId = 456;

  const response = await fetch(
    `https://server.smartlead.ai/api/v1/leads/${leadId}/unsubscribe?api_key=${API_KEY}`,
    { method: 'POST' }
  );

  const result = await response.json();
  if (result.ok) {
    console.log(`Lead ${leadId} unsubscribed globally`);
  }
  ```
</RequestExample>

## Response Codes

<ResponseField name="200" type="Success">
  Lead unsubscribed successfully
</ResponseField>

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

<ResponseField name="404" type="Not Found">
  Lead not found or you don't have access to it
</ResponseField>

<ResponseField name="500" type="Internal Server Error">
  Server error occurred
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "ok": true
  }
  ```

  ```json 200 - No Update theme={null}
  {
    "ok": false
  }
  ```

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

  ```json 404 - Not Found theme={null}
  {
    "error": "Lead not found - Invalid lead_id."
  }
  ```
</ResponseExample>

## Behavior Notes

<Info>
  When a lead is globally unsubscribed:

  * The `is_unsubscribed` flag is set to `true` on the lead record
  * The lead will not receive emails from any campaign
  * The lead remains in all campaigns but will not be contacted
  * This action affects all current and future campaigns
</Info>

<Tip>
  To unsubscribe a lead from a specific campaign only (not globally), use the campaign-specific unsubscribe endpoint: `POST /api/v1/campaigns/{campaign_id}/leads/{lead_id}/unsubscribe`
</Tip>

## Related Endpoints

* [Get Lead by Email](/api-reference/leads/get-by-email)
* [Get Campaign Leads](/api-reference/leads/get-by-campaign)
* [Delete Lead](/api-reference/leads/delete)
