---
title: "Delete a customer including all websites"
description: "This example focuses on a safe, explicit deletion flow."
---

Depending on your configuration, deleting a customer may or may not automatically delete related websites. To avoid surprises, we recommend deleting websites explicitly first.

## Prerequisites

- An API token with the required scopes

## 1) List websites for the customer

API reference:

- [List websites](/api/websites/list-websites)

Pseudo request:

```bash
curl -X GET "$API_BASE_URL/api/websites?customerId=123" \
  -H "Authorization: Bearer $TOKEN"
```

Collect all website IDs.

## 2) Delete each website

API reference:

- [Delete website](/api/websites/delete-website)

```bash
curl -X DELETE "$API_BASE_URL/api/websites/456" \
  -H "Authorization: Bearer $TOKEN"
```

Repeat for all websites of that customer.

## 3) Delete the customer

API reference:

- [Customers API](/api/customers)

```bash
curl -X DELETE "$API_BASE_URL/api/customers/123" \
  -H "Authorization: Bearer $TOKEN"
```

## Notes

- If your backend supports cascade deletes, step 2 might be optional, but doing it explicitly keeps automation predictable.

