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

# Delete Email Account

> Delete an email account and remove it from all campaigns

<Warning>
  Deleting an email account removes it from all campaigns and deactivates warmup. This action cannot be undone. Ensure no active campaigns rely on this account before deletion.
</Warning>

## Path Parameters

<ParamField path="email_account_id" type="number" required>
  The email account ID to delete
</ParamField>

## Query Parameters

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

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://server.smartlead.ai/api/v1/email-accounts/123?api_key=YOUR_KEY"
  ```

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

  API_KEY = "YOUR_API_KEY"
  account_id = 123

  response = requests.delete(
      f"https://server.smartlead.ai/api/v1/email-accounts/{account_id}",
      params={"api_key": API_KEY}
  )

  result = response.json()
  if result.get('ok'):
      print(f"Email account {account_id} deleted successfully")
  else:
      print(f"Error: {result.get('message')}")
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'YOUR_API_KEY';
  const accountId = 123;

  const response = await fetch(
    `https://server.smartlead.ai/api/v1/email-accounts/${accountId}?api_key=${API_KEY}`,
    { method: 'DELETE' }
  );

  const result = await response.json();
  if (result.ok) {
    console.log(`Email account ${accountId} deleted successfully`);
  } else {
    console.log(`Error: ${result.message}`);
  }
  ```
</RequestExample>

## Response Codes

<ResponseField name="200" type="Success">
  Email account deleted successfully
</ResponseField>

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

<ResponseField name="404" type="Not Found">
  Email account 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,
    "message": "Email account deleted successfully!",
    "emailAccountId": 123
  }
  ```

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

  ```json 404 - Not Found theme={null}
  {
    "ok": false,
    "message": "Email account not found!",
    "errorCode": "ACCOUNT_NOT_FOUND",
    "emailAccountId": 123
  }
  ```
</ResponseExample>

## Deletion Behavior

<Info>
  When an email account is deleted:

  * Removed from all campaign associations
  * Warmup status set to `INACTIVE` with reason "Email account is deleted by user action"
  * Smart sender domain mappings are deleted
  * Account is soft-deleted (not permanently removed from database)
</Info>

<Warning>
  Before deleting an email account, ensure:

  * No active campaigns depend solely on this account
  * You have alternative email accounts configured
  * All scheduled emails from this account have been sent or rescheduled
</Warning>

## Related Endpoints

* [Get All Email Accounts](/api-reference/email-accounts/get-all)
* [Suspend Email Account](/api-reference/email-accounts/suspend) - Temporarily disable without deleting
* [Add SMTP Email Account](/api-reference/email-accounts/add-smtp)
