---
title: "Delete Customer"
description: "Permanently deletes a customer and deactivates or deletes the users assigned only to it."
---

`DELETE /api/customers/:customerPublicId`

Permanently deletes a customer. Its monitors, check history, incidents, reports and screenshots
are removed with it. **This cannot be undone.**

Only organization admins may delete customers. Editors, readonly users and customer-scoped API
tokens receive `403`.

## Users of the customer

Users who have access **only** to this customer cannot keep their account without one. One of
two things always happens to them, chosen with the `userAction` query parameter:

| `userAction` | Effect |
|--------------|--------|
| `deactivate` (default) | The users are deactivated. They can no longer use the dashboard or the API and can be reactivated later with [Update User](/api/users/update-user). |
| `delete` | The users are deleted permanently. |

Users who also have access to other customers keep their account and only lose access to the
deleted customer. There is no option to keep users without a customer.

## Authentication

```bash
BASE_URL="https://uptimeify.io"
TOKEN="wsm_<your-api-token>"
```

## Example Request

```bash
curl -X DELETE "$BASE_URL/api/customers/6bfec6f6-245a-47ce-843b-157d97d56f88?userAction=delete" \
  -H "Authorization: Bearer $TOKEN"
```

## Example Response

```json
{
  "success": true,
  "message": "Customer deleted successfully",
  "userAction": "delete",
  "affectedUsers": 1
}
```

`affectedUsers` is the number of users that were deactivated or deleted.

## Common errors

- `400 Bad Request` with `data.code: "invalidUserAction"` when `userAction` is neither `deactivate` nor `delete`. Nothing is deleted.
- `403 Forbidden` with `data.code: "forbidden"` when the caller is not an organization admin or uses a customer-scoped token
- `404 Not Found` with `data.code: "customerNotFound"` when the customer does not exist in your organization
