Permanently removes a hosting account from the server.
Endpoint:
DELETE /api/v1/accounts/{id}
Authentication: Bearer token — see API Authentication Overview.
Request body: none.
[!CAUTION] This operation is irreversible. All files in the account's home directory, all databases owned by the account, all email accounts and their stored mail, the DNS zone, SSL certificates, PHP-FPM pool, and Nginx vhost are permanently deleted. There is no undo. Take a backup before calling this endpoint if the data might be needed.
Response
204 No Content on success. No response body.
Error Codes
| Status | Error | Cause |
|---|---|---|
| 404 | not_found |
No account with that ID exists |
| 403 | license_required |
License invalid — writes are blocked |
curl Example
curl -sk -X DELETE \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
https://SERVER_IP:8443/api/v1/accounts/42
A 204 response with no body indicates success.
What Gets Deleted
The following are removed when an account is deleted:
| Resource | Location |
|---|---|
| Website files | /home/{username}/ |
| Databases | MariaDB databases prefixed with {username}_ |
| Email accounts | /var/mail/vdomains/{domain}/ |
| Dovecot user entries | /etc/dovecot/users |
| Postfix vmailbox entries | /etc/postfix/vmailbox |
| DNS zone | PowerDNS records in MariaDB |
| Nginx vhost | /etc/nginx/sites-available/{domain}.conf |
| PHP-FPM pool | /etc/php/{version}/fpm/pool.d/{domain}.conf |
| SSL certificate | /etc/letsencrypt/live/{domain}/ |
WHMCS Integration
The Opterius WHMCS module calls this endpoint on the Terminate action. In WHMCS, termination is typically triggered manually by an admin or automatically after a configurable number of days past suspension. Verify your WHMCS automation rules before enabling automatic termination in production.
Recommended: Suspend Before Deleting
If you are automating termination via billing, it is good practice to suspend an account first and wait a grace period before deleting. Use POST /api/v1/accounts/{id}/suspend first, then call DELETE only after the grace period has passed.