Admin

API: Suspend and Unsuspend Account

Suspend or unsuspend a hosting account via the Opterius Panel API.

Last updated 1775606400

Suspending an account disables the account's websites (Nginx returns 503), disables FTP and SSH access, and blocks outbound mail. The account's files, databases, and configuration are preserved — suspension is fully reversible.

Suspend

Endpoint:

POST /api/v1/accounts/{id}/suspend

Authentication: Bearer token — see API Authentication Overview.

Request body: none.

Response — 200 OK:

{
  "data": {
    "id": 42,
    "username": "alice",
    "status": "suspended"
  }
}

curl example:

curl -sk -X POST \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  https://SERVER_IP:8443/api/v1/accounts/42/suspend

Unsuspend

Endpoint:

POST /api/v1/accounts/{id}/unsuspend

Authentication: Bearer token.

Request body: none.

Response — 200 OK:

{
  "data": {
    "id": 42,
    "username": "alice",
    "status": "active"
  }
}

curl example:

curl -sk -X POST \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  https://SERVER_IP:8443/api/v1/accounts/42/unsuspend

Error Codes

Status Error Cause
404 not_found No account with that ID exists
403 license_required License invalid — writes are blocked
409 conflict Account is already in the requested state (already suspended / already active)

WHMCS Integration

The Opterius WHMCS module calls /suspend on the Suspend action and /unsuspend on the Unsuspend action. These are triggered by overdue invoices in WHMCS automatically when the module is configured. You do not need to call these endpoints manually in a standard WHMCS setup.

Notes

Suspension and unsuspension are synchronous. The Agent applies the Nginx configuration change immediately. Expect the operation to complete in under 2 seconds.

If a suspended account is accessed via a browser, Nginx returns a 503 Service Unavailable with a standard suspension page.

Related