Overview
This endpoint allows authorized users to permanently delete a customer account. This is a destructive operation that removes all customer data and cannot be undone. Use with extreme caution.
This operation permanently deletes the customer account and all associated data. This action cannot be undone.
Authentication
This endpoint requires JWT authentication. Include your bearer token in the Authorization header.
Authorization
Access is restricted to high-level roles:
ADMIN : Full deletion permissions
MASTER : Full deletion permissions
RESALE : Can delete customers under their management
Path Parameters
The unique user ID of the customer to delete
Response
Indicates if the deletion was successful
Success or error message describing the operation result
Timestamp when the customer was deleted
curl -X DELETE "https://api.vpn.tv/customer/user123" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
Success Response
Error Response (404)
Error Response (403)
Error Response (401)
Error Response (409)
{
"success" : true ,
"message" : "Customer deleted successfully" ,
"deletedAt" : "2024-01-20T14:45:00.000Z"
}
Error Handling
Status Code Description Solution 200 Success Customer deleted successfully 401 Unauthorized Check your JWT token validity 403 Forbidden Verify your role permissions 404 Not Found Verify the user ID exists 409 Conflict Customer has active subscription or dependencies 500 Internal Server Error Contact support if persistent
Implementation Notes
Data Deletion Policy
Soft Delete : Customer records are marked as deleted but preserved for audit purposes
Hard Delete : Complete removal from database (admin-only in special cases)
Associated Data : Related transactions, logs, and subscriptions are handled according to retention policies
Cascade Operations
When a customer is deleted:
Active VPN sessions are terminated
Device connections are revoked
Email notifications may be sent
Audit Trail
All deletion operations are logged with:
Timestamp of deletion
User who performed the action
Security Considerations
Operation requires elevated permissions (ADMIN/MASTER/RESALE)
All deletion attempts are logged for security auditing
Best Practices
Before Deletion
Backup Customer Data : Export important customer information
Check Dependencies : Verify no active subscriptions or transactions
Notify Customer : Send deletion notification if required by policy
Document Reason : Record why the deletion is necessary
Error Recovery
If permission errors occur, verify user role and scope
For database conflicts, check for foreign key constraints