API ও কমান্ড লাইন

টোকেনসহ Manager API ধাঁচ ও Panel API ধাঁচের JSON API, প্রতিটি ফাংশন, হুক, আর account:create থেকে managerapi ও panelapi পর্যন্ত aiohpanel-এর প্রতিটি কমান্ড।

AIOhPanel has two JSON APIs shaped like the hosting panel's, and one command line program, aiohpanel. Use them to create accounts from a billing system, to script a server, or to build your own tools. Both APIs return JSON.

Manager API (Host Manager)

Address: https://<hostname>:2087/json-api/<function>?arg=value

curl -sk -H "Authorization: manager root:TOKEN" \
  "https://server1.example.com:2087/json-api/listaccts?search=example"

The answer has metadata (command, result, reason) and data. A wrong call returns ok: false with a reason. Every call acts as the user that owns the token, so a reseller sees only their own accounts.

FunctionArgumentsWhat it does
version, applistnonePanel version and driver; the list of functions.
listacctssearchAccounts with domain, user, package, owner, status.
accountsummaryuserOne account.
createacctdomain, password, username, contactemail, plan, ip, quota, bwlimit, hasshellCreate an account. Obeys the licence limit.
suspendacct, unsuspendacctuser, reasonSuspend or release.
removeacctuser, keepdnsTerminate.
passwduser, passwordChange an account password.
changepackageuser, pkgApply another package.
listpkgs, addpkg, killpkgname, quota, bwlimit, maxftp, maxsql, maxpop, maxlst, maxsub, maxpark, maxaddon; pkgnamePackages.
listzones, dumpzone, addzonerecorddomain, name, type, address or cname or txtdata, ttlDNS zones and records.
servicestatus, restartserviceserviceService state; restart one.
systemloadavg, gethostname, listips, showbwnoneLoad, hostname, IP addresses, bandwidth by account.
get_current_lang, license_statusnoneLanguage; licence state and package.
create_user_sessionuserA one-time sign-in address (valid 60 seconds) for the account's hosting panel.

The complete, current list is on Development → API Documentation in the Host Manager. Plugins can add their own functions.

Panel API (hosting panel)

Address: https://<hostname>:2083/execute/<Module>/<function>?arg=value, with Authorization: hosting USER:TOKEN.

curl -sk -H "Authorization: hosting demo:TOKEN" \
  "https://server1.example.com:2083/execute/Email/list_pops"

The answer has status (1 or 0), errors and data. The modules: Variables, StatsBar, DomainInfo, AddonDomain, SubDomain, Email (list_pops, add_pop, delete_pop, passwd_pop, list_forwarders, add_forwarder), Mysql (list_databases, list_users, create_database, delete_database, create_user, set_privileges_on_database), Ftp, Cron, DNS, SSL, Fileman, Quota, Bandwidth and Tokens.

Root can call a Panel API function for an account from the Host Manager port by adding hosting_user=<user>; the account must belong to the caller.

Tokens

  • Host Manager → Development → Manage API Tokens: a Token Name, an optional Expiration date and the Privileges (tick all, or only what the integration needs; all is for root).
  • Hosting panel → Security → Manage API Tokens: Token Name, Expires, Restrictions.

A token is shown once when you create it. Only a hash is kept, so a lost token cannot be shown again; revoke it and make a new one. The Security Advisor warns about tokens without an expiry date. A signed-in browser session also works for the API if it sends the CSRF header, which is how the panel's own pages call it.

Hooks

Development → Manage Hooks runs a script or calls a URL when something happens (a given event, at a given stage). Use it to tell a billing system that an account was created. A hook that runs a script runs as the panel user, so be careful what you allow.

The command line

aiohpanel is linked into /usr/local/bin by install.sh. Run it as root.

CommandWhat it does
aiohpanel versionVersion, schema and driver.
aiohpanel statusHostname, licence, accounts, load, memory and each service.
aiohpanel db:updateRun the database update after an update.
aiohpanel cron [--force]Run the panel cron once; --force ignores each job's timer.
aiohpanel license:activate KEYActivate a licence key.
aiohpanel license:statusState, key start, package, expiry, addons, account limit.
aiohpanel account:listTable of accounts.
aiohpanel account:create DOMAIN [--user= --pass= --email= --package=]Create an account; prints the generated password if you gave none.
aiohpanel account:suspend USER [reason]Suspend.
aiohpanel account:unsuspend USERUnsuspend.
aiohpanel account:terminate USER [--keepdns]Terminate.
aiohpanel account:passwd USER PASSSet a password.
aiohpanel root:passwd PASSReset the Host Manager root password (use it if you are locked out).
aiohpanel service:statusEach service, enabled or not, and its state.
aiohpanel service:restart CODERestart httpd, named, mysql, exim, imap, ftpd, php-fpm, sshd, crond and so on.
aiohpanel managerapi FUNCTION key=value ...Call any Manager API function as root.
aiohpanel panelapi USER Module::function key=value ...Call any Panel API function for an account.

Example:

aiohpanel account:create example.com --user=example --email=owner@example.com --package=default
aiohpanel managerapi listaccts search=example
aiohpanel panelapi example Email::list_pops

হালনাগাদ 2026-11-02