Skip to content

WHM createacct — UI vs API workflow, and which one to trust

The WHM Create a New Account UI hides defaults the API surfaces. A practical breakdown of when to use which path and how to make scripted account creation idempotent.

The first account on a new WHM server gets created through the UI and everyone moves on. The fiftieth account is a different problem — the package the reseller chose two months ago has changed, the IP pool has drifted, and the customer record in the CRM expects a username convention nobody told the operator clicking the form. By the time you notice, the difference between accounts is a half-dozen settings you can’t easily diff. Scripting createacct solves this, but only if you understand what the UI fills in for you.

What’s happening

WHM’s Create a New Account screen wraps createacct and supplies sensible defaults — owner, IP, theme, locale, mail routing — from the logged-in user’s preferences and the chosen package. The API takes none of those for granted. A bare whmapi1 createacct user=acme domain=acme.com will succeed but inherit zero package settings, leaving the account with the wrong quota, wrong feature list, and an unowned billing relationship. The fix is to always pass plan (package) and owner explicitly, and to read back the result before considering the create done.

How to verify

After a create — UI or API — confirm the account exists and matches the expected package:

whmapi1 accountsummary user=acme
whmapi1 list_packages
whmapi1 listaccts search=acme searchtype=user
tail -f /usr/local/cpanel/logs/access_log | grep createacct

If accountsummary returns plan=default when you expected gold-2026, the create did not apply the package. That happens when the package name has whitespace, hyphens the API normalizes differently, or when the calling token lacks the create-acct ACL on the package.

The fix

  1. Always pass plan and owner to createacct — never rely on caller defaults. The owner must be a real WHM user (root or a reseller); a typo creates an unowned account that resellers cannot see in their UI.
  2. Pre-check the username with whmapi1 list_users before calling create. Usernames are 1-16 chars, lowercase, no leading digit; the API will accept some forms the UI rejects, and those accounts cause downstream pain.
  3. Read back with accountsummary in the same script and assert on plan, ip, email, partition. A successful createacct response means the row was inserted; it does not mean every package setting applied cleanly.
  4. Wrap the call in a post-create hook (see /var/cpanel/hooks/postwwwacct/) that registers the account in your CRM, opens a DNS-cluster record, and emails the reseller. The UI does none of this for you.

For shops creating more than a handful of accounts per week, Stack Harbor’s cPanel and WHM management team standardizes onboarding so the fiftieth account looks exactly like the first.