> For the complete documentation index, see [llms.txt](https://docs.stammer.ai/stammer.ai-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stammer.ai/stammer.ai-docs/white-label/white-label-api/sub-accounts/delete-sub-account.md).

# Delete Sub-Account

You can interact with this API by sending a `DELETE` request. This allows you to delete a Sub-Account in your Agency Account. Make sure this action cannot be undone.

**API Endpoint**

The following endpoint/URL should be used in order to access this API:

```
https://app.stammer.ai/en/api/v1/subaccounts/delete
```

**Request Headers**

The API must have the following request headers:

```
Content-Type: application/json
Authorization: Token <Your-API-Token>
```

**Query Parameters**

The API accepts the following query parameters:

* `email` (Type: Email, Required)
  * Email address of the SubAccount.
  * Must be a valid email format.

\
**Request Example**

Here's an example of the request:

```python
import requests

# Define the API endpoint
url = "https://app.stammer.ai/en/api/v1/subaccounts/delete"

# Set up authentication and headers
headers = {
    'Authorization': 'Token <YOUR-API-TOKEN>',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}



# Data is passed in the request body as JSON
data = {

    "email": "john@example.com"

}
response = requests.delete(url, headers=headers, json=data)



# Process the response
if response.status_code in (200, 201, 202):
    result = response.json()
    print("Response data:", result)
else:
    try:
        error_data = response.json()
        error_message = error_data.get('message') or error_data.get('error', 'Unknown error')
        print(f"Error: {error_message}")
    except ValueError:
        print(f"Error: Status code {response.status_code}")

```

**Response Example**

Here's an example of the response:

```json
{
    "message": "Subaccount deleted successfully."
}
```

Learn More - <https://app.stammer.ai/en/api-docs/subaccount/delete/>
