Delete a customer including all websites

Safe deletion flow: remove websites first, then delete the customer.

Delete a customer including all websites

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:

Pseudo request:

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

Collect all website IDs.

2) Delete each website

API reference:

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:

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.