How to create a hosting account with the API

For server administrators · Updated 2026-10-29

On this page
  1. Before you start
  2. Request
  3. Example
  4. Response
  5. Errors
  6. Common questions

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
FieldRule
username2–16 characters, lowercase letters and digits, starting with a letter. Not taken, not reserved.
domainThe main domain, not already hosted on the server. www. and https:// are removed.
emailThe customer's contact email.
password8–128 characters with at least 3 of: lowercase, uppercase, digits, symbols.
packageThe 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). or Not 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.

Was this article helpful?

Still stuck?

Ask the AI about your exact situation — it answers from this knowledge base — or contact us.