How to create a hosting account with the API
POST /api/v1/accounts creates a hosting account exactly like Create Account in the admin panel: system user, website, DNS zone and home folder, on the package you name.
Before you start
- An administrator or reseller API token. Resellers need the Create accounts privilege.
- The package must exist. Use its exact name; list them with
GET /api/v1/packages.
Request
POST https://<server>:2087/api/v1/accounts
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
| Field | Rule |
|---|---|
username | 2–16 characters, lowercase letters and digits, starting with a letter. Not taken, not reserved. |
domain | The main domain, not already hosted on the server. www. and https:// are removed. |
email | The customer's contact email. |
password | 8–128 characters with at least 3 of: lowercase, uppercase, digits, symbols. |
package | The package name, exactly as in the panel. (Or package_id with its number.) |
Example
curl -s -X POST https://server1.example.com:2087/api/v1/accounts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"username":"shop1","domain":"shop-example.com","email":"[email protected]","password":"Str0ng-Passw0rd!","package":"Basic"}'
Response
{
"status": 1,
"data": {
"username": "shop1",
"domain": "shop-example.com",
"email": "[email protected]",
"package": "Basic",
"status": "active",
"suspend_reason": null,
"ip": "203.0.113.10",
"disk_used_mb": 0,
"disk_limit_mb": 1024,
"bandwidth_used_mb": 0,
"bandwidth_limit_mb": 10240,
"created_at": "2026-10-29 10:12:00"
}
}
The account exists at once. The server finishes setting it up (system user, website, email key, certificate request) in a few seconds; the account.created webhook tells your system too.
Errors
All answer HTTP 422 with "status": 0 and an error, for example:
Package not found.— no package with that name. An administrator's token finds the administrator's packages; a reseller's finds the reseller's own and the shared ones.That username is already taken.Username must be 2-16 characters, start with a letter, and contain only lowercase letters and digits.The domain shop-example.com is already hosted on this server.Password must contain at least 3 of: lowercase, uppercase, digits, symbols.- For resellers:
Account limit reached (10).orNot enough disk space left in your reseller allocation.
Common questions
Can I send form fields instead of JSON?
Yes. Use -d username=shop1 -d domain=shop-example.com … without the JSON header.
How do I log the customer in after creating the account?
Ask for a one-time link with POST /api/v1/accounts/{username}/login. See single sign-on link.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- REST API overview: authentication, requests and responses
How the REST API v1 works: base URL, Bearer token authentication, JSON or form bodies, the response envelope, HTTP status codes and every endpoint.
- Suspend, change package, password or terminate via the API
Manage hosting accounts with the REST API: list, suspend, unsuspend, change password or package, terminate, list packages, task and server status.
- 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 create a hosting account (new customer)
Create a hosting account in the admin panel: domain, username, password, contact email and package, what the server sets up and the rules of each field.