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.
| Function | Arguments | What it does |
|---|---|---|
version, applist | none | Panel version and driver; the list of functions. |
listaccts | search | Accounts with domain, user, package, owner, status. |
accountsummary | user | One account. |
createacct | domain, password, username, contactemail, plan, ip, quota, bwlimit, hasshell | Create an account. Obeys the licence limit. |
suspendacct, unsuspendacct | user, reason | Suspend or release. |
removeacct | user, keepdns | Terminate. |
passwd | user, password | Change an account password. |
changepackage | user, pkg | Apply another package. |
listpkgs, addpkg, killpkg | name, quota, bwlimit, maxftp, maxsql, maxpop, maxlst, maxsub, maxpark, maxaddon; pkgname | Packages. |
listzones, dumpzone, addzonerecord | domain, name, type, address or cname or txtdata, ttl | DNS zones and records. |
servicestatus, restartservice | service | Service state; restart one. |
systemloadavg, gethostname, listips, showbw | none | Load, hostname, IP addresses, bandwidth by account. |
get_current_lang, license_status | none | Language; licence state and package. |
create_user_session | user | A 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.
| Command | What it does |
|---|---|
aiohpanel version | Version, schema and driver. |
aiohpanel status | Hostname, licence, accounts, load, memory and each service. |
aiohpanel db:update | Run the database update after an update. |
aiohpanel cron [--force] | Run the panel cron once; --force ignores each job's timer. |
aiohpanel license:activate KEY | Activate a licence key. |
aiohpanel license:status | State, key start, package, expiry, addons, account limit. |
aiohpanel account:list | Table 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 USER | Unsuspend. |
aiohpanel account:terminate USER [--keepdns] | Terminate. |
aiohpanel account:passwd USER PASS | Set a password. |
aiohpanel root:passwd PASS | Reset the Host Manager root password (use it if you are locked out). |
aiohpanel service:status | Each service, enabled or not, and its state. |
aiohpanel service:restart CODE | Restart 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