Skip to content
Documentation

API reference

The external API is what an API key can call: a Discord bot, a monitoring check, a deployment script. It lives under /api/external on your panel's address (https://panel.dylaris.com/api/external on DYLARIS hosted) and addresses servers by their UUID, which you find in the panel or with GET /api/external/servers.

Authentication

Create a key under Account > API keys. You confirm it with your password (and your 2FA code if you use one), and the key is shown exactly once. Store it like a password; DYLARIS only keeps a hash of it.

Send it on every request:

shell
Authorization: Bearer dyl_<your key>

There is no other way to pass a key: not in the URL, not in a cookie. A key cannot sign in to the panel, create other keys, or change your account.

Scope

A key holds exactly what you picked when you created it:

  • Servers - the servers it may touch. Any other server answers 403.
  • Permissions - the capabilities it carries, for example console.send or power.restart. You can only give a key permissions you hold yourself on those servers. Permissions that manage access (API keys, roles, members) can never be put on a key.
  • Rate limit - requests per minute for this key, 1 to 600 (default 60).
  • Expiry - 30, 90 or 365 days, or never.

The key is checked against what you hold now on every request: if you lose access to a server, or an operator stops allowing a permission on user keys, the key stops working for it at once. Revoking a key under Account > API keys also takes effect immediately. Signing out everywhere does not revoke keys; resetting your password by mail, or an operator setting your password or resetting your 2FA, revokes all of them.

On a self-hosted platform the operator decides whether users other than admins may hold keys at all (off by default) and may narrow the permissions a user key can carry.

Endpoints

Method and pathPermission needed
GET /api/external/serversnone: lists the servers in the key's scope
GET /api/external/usageusage.read
GET /api/external/servers/{uuid}overview.read
POST /api/external/servers/{uuid}/powerpower.start, power.stop, power.restart or power.kill, matching the action
GET /api/external/servers/{uuid}/console/historyconsole.read
POST /api/external/servers/{uuid}/console/commandconsole.send
GET /api/external/servers/{uuid}/stats/historystats.read
GET /api/external/servers/{uuid}/backup-jobsbackups.read
POST /api/external/servers/{uuid}/backup-jobs/{jobId}/triggerbackups.create
POST /api/external/rcon/{uuid}/execrcon.exec

Bodies are JSON: power takes {"action": "restart"}, a console command and RCON take {"command": "say hello"}. For example:

shell
curl -X POST https://panel.dylaris.com/api/external/servers/<uuid>/power \
  -H "Authorization: Bearer dyl_<your key>" \
  -H "Content-Type: application/json" \
  -d '{"action":"restart"}'

The full list with a ready-to-paste request and the response for each route is generated from the router and shown below. The Managed Gateway endpoints (/api/external/gateway/*) have their own page: Gateway API.

Errors and limits

StatusMeaning
401No key, an unknown key, or a revoked or expired one
403The key is not scoped to that server, lacks the permission, or you no longer hold it
429The key's rate limit is used up; wait for Retry-After seconds

Failed attempts (unknown, revoked or expired keys, and refused requests of a valid key) are also limited to 120 per minute per source address. Successful requests do not count against that limit, so a key reaches its own rate from a single host.

GET /api/external/usage also has a fixed ceiling of 120 requests per minute per key, whatever rate limit the key itself carries. The figures change once a minute, so polling faster returns the same numbers.

Audit log

An API key counts like a member you invited:

  • Creating a key switches auditing on for every server in its scope, and the first use on any server switches it on there too.
  • The server's audit log shows what the key did as key: <name> (owner <you>), so a script's restart never reads like yours.
  • Every write (power, console command, RCON, backup) is its own entry.
  • Reads (server details, console history, statistics, backup list) and refused requests are bundled: one entry per key, server and kind per 10 minutes, with a count. A refusal on a server you can no longer reach goes to your account's log instead of that server's.

Creating and revoking keys is recorded too. Name your keys after what uses them (discord-bot, uptime-check): the name is what the log shows, at most 64 characters without parentheses, unique among your active keys.

The 10 endpoints an API key can call, each with the capability that gates it, a request you can paste into a terminal, and the JSON that comes back. The route list is generated from the router itself, so it describes what is running rather than what someone remembered to write down.

The credential

One header, on every request:

Authorization: Bearer dyl_your_api_key
  • A key is scoped: you choose its capabilities, you choose which servers it may touch, it has its own rate limit, and you can revoke it without touching anything else.
  • It never gains authority from whoever holds it. Every request re-checks that the account that minted the key still holds the capability being used, so removing someone from a server stops the keys they made for it - nobody has to remember to revoke them.
  • There is no admin API key. Panel administration capabilities cannot be carried by a key at all, on any account. An admin's key reaches exactly these routes, on the servers it was scoped to, and nothing else.
  • A key scoped to no servers can use no per-server capability, so that combination is refused when the key is created rather than issued as one that fails later.

Keys are made in the panel under your account. Whether users other than admins may hold one at all is an operator setting and it is off by default: no "New API Key" button means an admin has not turned it on.

/api/external10

Errors

Every error has the same shape, with the matching HTTP status:

{"success": false, "message": "..."}
401
The key is invalid, revoked, or its owner is gone.
403
Valid key, but it does not carry the capability this route needs - or its owner no longer does.
404
No such server, or one outside this key's allowlist. The two are deliberately indistinguishable.
429
Over a rate limit. Retry-After: 60 says how long to wait. Honour it: there is a per-key limit and a per-IP limit checked before the database is touched at all.
503
The first-run wizard has not completed, or maintenance mode is blocking writes. Back off rather than retrying immediately.

One exception is worth building around: RCON answers 200 with success: false when the command could not run. Check the field, not the status.

NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.