Reference
The API
What this does: the API lets your own programs and scripts do what you do in the panel: make accounts, add domains, read the status and so on, without clicking. API tokens let a script sign in, and event hooks tell another system when something happens.
When you need it: when you want to connect freePanel to another system, such as a billing system or your own scripts. You don't need it to run your server.
API stands for "application programming interface": a set of addresses on your server that a program can call, sending and receiving data instead of web pages.
The full reference
The complete list of every API address, what each takes and what it answers, is in the admin panel, and always matches the freePanel version your server runs:
- Branding and API > API reference lists every route (how).
- Branding and API > API shell lets you try a route as yourself, read the answer, and copy it as a
curlcommand (how). Your customers have their own, in Advanced > API shell (how).
This page is an overview to get you started.
How it works
- Every address starts with
/api/v1, on the panel's own port:https://server.example.com:7443/api/v1/...for the admin panel,https://server.example.com:7444/api/v1/...for the customer panel. Each port answers only for its own panel. - Data goes in and out as JSON, a plain-text way of writing data that most programming languages read. A request with data must say
Content-Type: application/json. - Times are in UTC. Sizes are in megabytes.
- When something is wrong, the answer says what, with an error code and a message, and names the field that was wrong.
- A script signs in with an API token (below). The panel's own pages use a session from signing in instead.
A first call, which needs no sign-in and checks the panel answers:
curl https://server.example.com:7443/api/v1/health
{"status":"ok","realm":"admin","setup_required":false}
API tokens
An API token is a long secret that lets a script call the API as you, without your password. You can limit what it may do, for how long, and from which addresses.
Where: Branding and API > API tokens (for you, the admin). Your customers make their own in Security > API tokens, for their account only.
To make an API token
- Open Branding and API > API tokens.
- Under Make a token, type a Name that says what it is for, such as
billing. - Under What it may do, choose Read only (it can only read) or Full (it can make changes too).
- In Valid for (days), type how many days it lasts, from 1 to 365. It is not renewed.
- If the script always runs from the same place, list its addresses in Addresses it may be used from, one on each line. Leave it empty for any address.
- In Your password, type the password you sign in with, to confirm it is you.
- Click Make token.
- You see Your new token: billing. This is the only time the token is shown. Click Copy the token, keep it somewhere safe, then click I have copied it. The token starts with
fpt_.

Each step and button is described in API tokens. For customers' tokens, see API tokens in the hosting panel.
Using a token
Send it in the Authorization header of each request:
curl -H "Authorization: Bearer fpt_YOUR-TOKEN" \
https://server.example.com:7443/api/v1/accounts
- A Read only token can only read. Reading is still powerful: it can see logs, files and backups. Keep it as safe as a full one.
- A Full token can do what you can in the panel, except what makes or protects a way in: signing in, passwords and two-factor, API tokens, event hooks, the licence, root access, logins, resellers, team members and staff logins. Those need you signed in yourself.
- Anything wrong with a token (wrong, expired, revoked, from an address it isn't allowed from) gets the same answer:
401 invalid or expired token. - Everything a token does is in Services and status > Audit log, with
(via API token NAME).
If a token leaks, revoke it at once on the same page. Changing your password also ends every token of yours in the admin panel, so make new ones afterwards and put them in your scripts. Tokens made in the customer panel are not ended.
Event hooks
An event hook tells another system when something is done on your server: for example, when an account is made or removed. freePanel sends a short message to an address you choose, each time.
Where: Branding and API > Event hooks
To add an event hook
- Open Branding and API > Event hooks.
- Under Make a hook, type a Name, such as
crm. - In Address, type the
https://address that should receive the messages, such ashttps://crm.example.com/hook. It can't be this server or a network of its own. - In Actions, type the events it wants, one on each line:
*for everything, a family such asaccount.*, or one event such asaccount.create. The names are those of the audit log. - Leave Send as soon as it is made ticked to start at once.
- In Your password, type the password you sign in with.
- Click Make hook.
- You see The signing secret of crm. This is the only time it is shown. Click Copy the secret, give it to the receiving system so it can check each message really came from your server, then click I have copied it. The secret starts with
whsec_. - To check it works, click Send a test next to the hook. You see The test was delivered: ....

Each step and button is described in Event hooks.
What the receiver gets
Each event is one POST request with a JSON body: {id, type, time, result, actor:{name}, target, detail, server}, the same as the audit log entry. It never holds a password or key.
The headers say which event it is (X-FreePanel-Event), give a delivery ID (X-FreePanel-Delivery), and sign it (X-FreePanel-Signature: t=SECONDS,v1=HEX). The receiver checks the signature: HEX is the HMAC-SHA256 of SECONDS, a dot and the body, with the secret as the key. It should refuse a time that is not recent.
- A
2xxanswer means delivered. Anything else is tried again after 30 seconds, 2 minutes, 10 minutes, 1 hour and 6 hours, then given up. - A message can arrive more than once, and not in order. Use the delivery ID to drop repeats.
- Events that happened while a hook was off are never sent.