Delete Customer
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.
Organization admins, editors and global admins may delete customers. Readonly users, global
supporters, responders and customer-scoped API tokens receive 403. An editor assigned to
specific customers can delete only those customers (any other id answers 404); an editor
without customer assignments can delete every customer of the organization.
Two things stay with admins. Only an admin may send userAction=delete; an editor gets 403
with customerUserDeleteAdminOnly and uses the default deactivate. An editor assigned to
customers cannot delete the last of them: they would end up without a customer and deactivate
their own account, so the request answers 409 with cannotDeleteOwnLastCustomer. Both checks
run before anything is deleted.
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. |
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
BASE_URL="https://uptimeify.io"
TOKEN="wsm_<your-api-token>"Example Request
curl -X DELETE "$BASE_URL/api/customers/6bfec6f6-245a-47ce-843b-157d97d56f88?userAction=delete" \
-H "Authorization: Bearer $TOKEN"Example Response
{
"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 Requestwithdata.code: "invalidUserAction"whenuserActionis neitherdeactivatenordelete. Nothing is deleted.403 Forbiddenwithdata.code: "forbidden"when the caller is neither an organization admin nor an editor (readonly, global supporter, responder) or uses a customer-scoped token403 Forbiddenwithdata.code: "customerUserDeleteAdminOnly"when an editor sendsuserAction=delete. Nothing is deleted.409 Conflictwithdata.code: "cannotDeleteOwnLastCustomer"when an editor assigned to customers would delete the last of them. Nothing is deleted.404 Not Foundwithdata.code: "customerNotFound"when the customer does not exist in your organization