Developer Tools
Create API tokens for billing software and scripts, use the account API and its endpoints, run your own scripts on account events, and connect the help chat to an AI provider.
The Developer Tools section of the admin menu connects intoPanel to other systems. API Tokens creates the keys that billing software and scripts use. API Documentation describes every API call. Event Scripts (Hooks) runs programs of your own when an account is created, deleted, suspended or restored. The help chat's optional AI provider is also set up under Developer Tools; see Help Chat AI and Documentation and Help Chat.
API Tokens#
In the admin area, open Developer Tools → API Tokens (/admin/api). A token lets another system, such as billing software or a script, manage hosting accounts on this server through the API, with the rights of an administrator.
To create a token:
- Under Create a token, give it a Name (up to 40 letters, digits, spaces, dots, "-" or "_"), for example "Billing system".
- Optionally, under Only from these addresses, enter the IP addresses or networks it may be used from, separated by commas, such as
203.0.113.5, 203.0.113.0/24. Leave it empty to allow any address. - Under What the token may do, choose Everything, Create and manage accounts, but not delete them, or Read only.
- Optionally, set the Last day it works. Leave it empty for a token without an end.
- Click Create token.
The new token (it starts with ipt_) is shown once under Your new token. Copy it now: only a fingerprint of it is stored, and it cannot be shown again. If you lose it, create a new one.
The Tokens table lists each token with what it may do, where it is allowed from, when it was created, when it expires and when it was last used (and from which address). Click Remove to revoke a token; systems using it can no longer connect.
Good to know:
- Give each system its own token, with no more rights than it needs, and tie it to the system's address when you can.
- You can have up to 50 tokens.
- Repeated calls with a wrong token from one address are blocked for a while.
API Documentation#
In the admin area, open Developer Tools → API Documentation (/admin/api/docs). The page describes every call of the API, with its fields, what the answer holds, the token scope it needs and a ready-made curl example. Download as an OpenAPI 3 file saves the same description for tools that read OpenAPI.
How to call the API:
- Send the token in the
Authorizationheader:Authorization: Bearer ipt_your_token. - Addresses start with
https://your-server:port/api/v1/. - POST data is a JSON object of strings.
- Every answer is a JSON object:
"ok": truewith the result, or"ok": falsewith"error"saying why.
Answers use these HTTP status codes: 401 for a missing, wrong or expired token; 403 when the token's scope does not allow the call; 422 when the call is refused (the error field says why); 429 after too many failed attempts.
Scopes: a read token may only use GET calls. A manage token may do everything except delete accounts. A token with everything may do all calls.
Example:
curl -s -H "Authorization: Bearer ipt_your_token" https://panel.example.com:port/api/v1/accountsThe calls themselves are listed under "API endpoints".
API endpoints#
In the admin area, open Developer Tools → API Documentation (/admin/api/docs) for the full description of each call. The API has these endpoints:
Reading (scope "read" or wider):
GET /api/v1/system: the server's name, software versions and current load.GET /api/v1/packages: all packages with their limits.GET /api/v1/accounts: all hosting accounts. Add?q=textto search by username or domain.GET /api/v1/accounts/{username}: one account: package, suspension, disk and data transfer used.GET /api/v1/list_account_enhancements: all account add-on features with the accounts that have each.GET /api/v1/accounts/{username}/enhancements: the add-on features, each marked with whether this account has it.
Managing (scope "manage" or wider):
POST /api/v1/accounts: create an account. Fields:username(2 to 16 lowercase letters and digits, starting with a letter),domain,password(at least 10 characters) are required;packageandemailare optional.POST /api/v1/accounts/{username}/suspend: suspend an account; optionalreason.POST /api/v1/accounts/{username}/unsuspend: restore a suspended account.POST /api/v1/accounts/{username}/package: move an account to another package; fieldpackage.POST /api/v1/accounts/{username}/password: set a new panel password; fieldpassword.POST /api/v1/assign_account_enhancementandPOST /api/v1/unassign_account_enhancement: give or take away an add-on feature; fieldsuserandid.POST /api/v1/accounts/{username}/modifyaccount: change thepackageand the set of add-on features (enhancements, comma-separated IDs); each only when given.
Deleting (scope "everything"):
DELETE /api/v1/accounts/{username}: delete an account with its websites, mail and databases. This cannot be undone.
Event Scripts (Hooks)#
In the admin area, open Developer Tools → Event Scripts (Hooks) (/admin/hooks). A hook is a program of your own that the panel runs when something happens to an account, for example to tell a billing system or to write a log.
The events are:
account-created: after a hosting account is created.account-deleted: after a hosting account is deleted.account-suspended: after a hosting account is suspended.account-unsuspended: after a suspended account is restored.
To add a hook:
- On the server, put a program named exactly after the event into
/etc/intopanel/hooks, for example/etc/intopanel/hooks/account-created. - Make it owned by root and run
chmod 700on it. - Reload the page: the event shows Installed. If the file is there but not safe to run, it shows Not run with the reason.
The program gets the account's username as its first argument and, when an account is created, the main domain as the second. The same values are in the environment as INTOPANEL_USER, INTOPANEL_DOMAIN and INTOPANEL_EVENT. Example:
#!/bin/bash
echo "$(date) $INTOPANEL_EVENT $INTOPANEL_USER $INTOPANEL_DOMAIN" >> /root/account-events.logGood to know:
- Hooks run as root, so only root may be able to write to the file and its folder; anything else is not run.
- A hook runs after the action, does not hold it up, and is stopped after 60 seconds.
- What it prints goes to the panel's service log (
journalctl -u intopaneld). The Last run column shows when it last ran and whether it succeeded. - Hooks run for actions from the panel and from the API alike.
Help Chat AI#
In the admin area, open Developer Tools → Help Chat AI (/admin/mtool/help-ai). Here you can connect the panel's help chat to an AI provider, Anthropic Claude or OpenAI, so that it writes answers in its own words from the documentation. Without this setup the help chat still works: it answers by showing the matching passages of the documentation.
To set it up, choose the provider, enter your API key from that provider, choose the model, switch it on and save. The key is stored on the server and never shown again; to change it, enter a new one.
Good to know:
- With a provider switched on, each question and the matching documentation passages are sent to that provider.
- A limit of questions per user per hour applies.
The full description is in Documentation and Help Chat.
Something missing? Ask in the community or open a ticket.