API and integrations
The REST API, API tokens, webhooks and the WHMCS module.
- REST API overview: authentication, requests and responses Administrators
How the REST API v1 works: base URL, Bearer token authentication, JSON or form bodies, the response envelope, HTTP status codes and every endpoint.
- How to create an API token for scripts and billing
Create an API token in the admin panel or the control panel for the REST API or a billing system, copy it once, see when it was last used, and revoke it.
- How to restrict an API token (IP addresses, expiry, read only)
Limit an API token to your billing server's IP addresses, let it expire after 7 to 365 days, or make it read only, and the errors you get when a limit applies.
- How to create a hosting account with the API Administrators
Create a hosting account with POST /api/v1/accounts: the required fields, a complete curl example, the account object you get back and the errors to expect.
- Suspend, change package, password or terminate via the API Administrators
Manage hosting accounts with the REST API: list, suspend, unsuspend, change password or package, terminate, list packages, task and server status.
- Single sign-on: one-time login link to the control panel Administrators
Create a one-time link that signs a customer in to their control panel from your client area. Valid 60 seconds, single use, with code examples.
- Customer API: automate mailboxes, databases, DNS and cron Customers
Use your hosting account's own API token to manage mailboxes, forwarders, MySQL databases, DNS records and cron jobs from scripts, with curl examples.
- API returns 401 Unauthorized, 403 or IP blocked
Fix API errors: 401 Unauthorized, expired token, address not allowed, IP blocked after failed attempts, read-only token, missing privilege and 422.
- How to add a webhook (get notified when accounts change) Administrators
Send a signed JSON message to your billing, monitoring or chat system when an account is created, suspended or terminated, a mailbox is added and more.
- How to verify webhook signatures (HMAC-SHA256) Administrators
Check the X-Sahaab-Signature header of webhook messages with your signing secret, with code for PHP, Node.js and Python, and skip duplicates.
- Webhook events and JSON payloads reference Administrators
Every webhook event the server sends — accounts, domains, mailboxes, disk and bandwidth limits, failed tasks, support tickets — with the JSON body of each.
- How to connect WHMCS to the control panel (provisioning module) Administrators
Install the WHMCS module, add the server with an API token and pick packages, so WHMCS creates, suspends, upgrades and terminates accounts.
- Connect Blesta, HostBill and other billing systems (json-api) Administrators
Use the /json-api interface on port 2087 to provision hosting from Blesta, HostBill and other billing systems: functions, parameters and examples.