Service Tools
The five endpoints that run the provider panel's tools, call module methods and produce sign-in links.
Overview
Tools let you do through the API what the service's provider panel does: create a database, add a mailbox, look at files. You get the same data the panel sees, but raw instead of as HTML.
Tools exist on hosting and server services only. Domain services have their own endpoints, and special products have no tool system at all — they use the module method route instead, which is where power operations, console details and the like are called.
Reference
Listing the Tools
Returns the tools the service's module offers and which operations each accepts.
curl 'https://panel.example.com/api/v1/admin/services/506/tools' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.example.com/api/v1/admin/services/506/tools', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.example.com/api/v1/admin/services/506/tools');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Read the capability before trying an operation: modules support tools to different degrees.
$tools = Api::Services()->GetServiceTools(['id' => 506])['data'];
foreach ($tools as $tool) {
$canCreate = in_array('create', $tool['capabilities'], true);
}{
"data": [
{
"key": "databases",
"group": "databases",
"label": "Databases",
"icon": "bi bi-database",
"capabilities": ["list", "create", "delete"]
},
{
"key": "email-accounts",
"group": "email",
"label": "Email Accounts",
"icon": "bi bi-envelope",
"capabilities": ["list", "create", "edit", "delete"]
}
]
}{
"error": {
"code": "tools_not_supported",
"message": "This service type does not expose tools."
}
}Reading a Tool
Returns what the tool read from the provider, in its raw form.
curl 'https://panel.example.com/api/v1/admin/services/506/tools/databases' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.example.com/api/v1/admin/services/506/tools/databases', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.example.com/api/v1/admin/services/506/tools/databases');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// The panel renders HTML, the API returns RAW data: the shape differs between modules.
$response = Api::Services()->GetServiceToolData(
['id' => 506, 'tool' => 'databases'],
);{
"data": {
"databases": [
{
"name": "user_app",
"size": 50855321,
"tables": 42,
"users": ["user_admin"]
}
],
"users": ["user_admin"],
"prefix": "user_"
}
}Running a Tool Operation
Runs an operation on the tool. The module's own validation checks the body fields.
curl -X POST 'https://panel.example.com/api/v1/admin/services/506/tools/databases/create' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name":"user_app"}'const res = await fetch('https://panel.example.com/api/v1/admin/services/506/tools/databases/create', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'user_app' }),
});
const body = await res.json();$ch = curl_init('https://panel.example.com/api/v1/admin/services/506/tools/databases/create');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['name' => 'user_app']),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// The operation really runs ON THE SERVER: delete calls cannot be undone.
$response = Api::Services()->RunServiceToolAction(
['id' => 506, 'tool' => 'databases', 'action' => 'create'],
[],
['name' => 'user_app'],
);Calling a Module Method
Calls a method the module allows. This is the way in for service types with no tool system.
curl -X POST 'https://panel.example.com/api/v1/admin/services/506/module-method' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"method":"vnc_info"}'const res = await fetch('https://panel.example.com/api/v1/admin/services/506/module-method', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ method: 'vnc_info' }),
});
const body = await res.json();$ch = curl_init('https://panel.example.com/api/v1/admin/services/506/module-method');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['method' => 'vnc_info']),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// The outcome can arrive in three different fields: a return value, printed output, or a redirect.
$response = Api::Services()->UseServiceModuleMethod([
'id' => 506,
'method' => 'vnc_info',
]);
$data = $response['data']['result']
?? $response['data']['output']
?? $response['data']['redirect_url'];{
"data": {
"method": "vnc_info",
"redirect_url": null,
"result": { "host": "203.0.113.10", "port": 5901 },
"output": null
}
}{
"error": {
"code": "invalid_method",
"message": "Module method is not callable."
}
}A Sign-in Link for the Panel
Produces a one-click sign-in link for the service's panel.
curl -X POST 'https://panel.example.com/api/v1/admin/services/506/sso' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"root":false}'const res = await fetch('https://panel.example.com/api/v1/admin/services/506/sso', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ root: false }),
});
const body = await res.json();$ch = curl_init('https://panel.example.com/api/v1/admin/services/506/sso');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['root' => false]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// The link carries a session: keep it out of logs, do not share it, use it quickly.
$response = Api::Services()->GetServiceSso(['id' => 506]);
$url = $response['data']['url'];Pitfalls
These endpoints do not update a record; they reach the provider and have the work done there. Delete operations really remove the client's data and cannot be undone. Check the capabilities in the tool list before trying one, since an unsupported operation is refused.
Tool data comes back raw and its shape differs between modules: one hosting panel returns databases under different keys than another. Parsing written against a single module breaks on the second one, so do not assume a fixed schema.
You cannot pick the method name freely: only ones the module marks callable, or that have a matching handler, will run, and the rest answer invalid_method. That is a security boundary, so do not assume every public method on the module is reachable.
Tools switched off for the client on a server are switched off for API calls as well. A tool you can see as an administrator in the panel may be unreachable through the API with the same key, and the reason is the restriction setting on the server rather than your permissions.
The link opens a session when clicked. Logging it, storing it or sharing it means sharing access to that account, so treat it as a short-lived credential. A call asking for the administrator sign-in opens the root of the panel, not one client account.
Related Articles
Thanks for your feedback!
Our support team is here around the clock for anything you can't find above.