Skip to content

API keys for scripts and bots

An API key lets a script, a bot or a monitoring tool use the TalePanel API without your password or 2FA. A key acts as your account, but only with the rights you pick for it and, if you like, only on chosen servers. It never gets more than your own permissions on a server.

  1. Go to Settings → API keys and click New key.
  2. Enter a Name (1 to 64 characters), for example discord-bot.
  3. Tick the Rights the key needs. Reading your servers is always allowed.
  4. Under Servers, choose All my servers, including ones I get later, or Only these servers and tick them.
  5. Pick when it Expires: 30 days, 90 days, 1 year or never.
  6. Click Create key and copy the key right away. It is shown once. The panel stores only a SHA-256 hash of it and cannot show it again.

Keys start with tp_. An account can have at most 25 keys, and a key can be limited to at most 100 servers.

The list under Settings → API keys shows each key’s first characters, rights, servers, creation date, expiry, and when and from which IP address it was last used.

Right (scope) What it allows
(every key) Read servers you can see: list, details, metrics, logs, players, worlds, mods, plugins, scheduled tasks, saved game commands, backups, backup schedules, update status, Hytale versions.
Power (power) Start, stop, restart and kill.
Console (console) Send console commands and run saved game commands.
Manage (manage) Change server settings, reinstall, start a Hytale update, create, change and delete scheduled tasks, switch the active world.
Backups (backups) Create, restore, download and delete backups, retry an off-site upload, manage backup schedules.
Players (players) Kick, ban, unban, mute and whitelist players.

A scope only opens a route. Behind it the normal permission checks still apply, with your account’s permissions on that server. For example, a key with Console can only send the commands your console role allows (see What each role may type in the console), and a key with Backups can only restore if you have backup.restore.

Keys may only call a fixed list of server routes. Everything else answers 403 with “this endpoint is not available to API keys”, whatever your account may do in the browser. That includes:

  • your account, password, 2FA and sessions,
  • the admin area, users and nodes,
  • creating, listing or deleting API keys, so a key cannot make another key,
  • invitations,
  • the file manager and mod installs,
  • the live console stream.

A leaked key therefore cannot change your password, lock you out or reach the admin area. It can still do what its scopes allow on its servers, so give each key only what it needs.

Send the key as a bearer token:

Authorization: Bearer tp_...

The examples below assume:

Terminal window
export TALEPANEL_URL=https://panel.example.com
export TALEPANEL_API_KEY=tp_...

List your servers (any key):

Terminal window
curl -sS "$TALEPANEL_URL/api/v1/servers" \
-H "Authorization: Bearer $TALEPANEL_API_KEY"

The answer is {"servers": [...]}. Each server has an id, name and status. A key limited to some servers only sees those.

Start a server (Power):

Terminal window
curl -sS -X POST "$TALEPANEL_URL/api/v1/servers/<server-id>/start" \
-H "Authorization: Bearer $TALEPANEL_API_KEY"

stop, restart and kill work the same way.

Send a console command (Console). The field is cmd:

Terminal window
curl -sS -X POST "$TALEPANEL_URL/api/v1/servers/<server-id>/console" \
-H "Authorization: Bearer $TALEPANEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"cmd": "say Restart in 5 minutes"}'

The API answers 202 with {"message": "command queued"}. A command above your console role gets 403.

Errors come back as JSON with an error field, for example the API key does not have the power scope or the API key is not allowed to access this server. An expired, revoked or unknown key gets 401. The normal rate limit of 120 requests per minute per client IP applies.

The repository ships a small client for scripts and cron jobs, examples/api/talepanel.sh. It needs curl and python3:

Terminal window
export TALEPANEL_URL=https://panel.example.com
export TALEPANEL_API_KEY=tp_...
examples/api/talepanel.sh servers
examples/api/talepanel.sh say <server-id> "Restart in 5 minutes"
examples/api/talepanel.sh cmd <server-id> "world save"
examples/api/talepanel.sh restart <server-id>
examples/api/talepanel.sh backup <server-id> "Before update"
examples/api/talepanel.sh players <server-id>

say and cmd need Console, start, stop and restart need Power, backup needs Backups. When a call fails, the script prints the HTTP status and the API’s error message.

Click Revoke (the bin icon) next to the key under Settings → API keys. Scripts using it stop working at once. Revoke a key as soon as you think it leaked, and create a new one.

A key also stops working when it expires, and all keys of an account stop working when the account is disabled.

Write actions made with a key are written to the audit log like any other, under your account. The entry’s payload carries via_api_key with the key’s ID, name and prefix, so you can tell a bot’s actions from your own. See Roles and permissions.

Keys are managed with a normal panel session, not with a key: GET /api/v1/api-keys, POST /api/v1/api-keys (body: name, scopes, optional server_ids, expires_in_days from 0 for never to 3650) and DELETE /api/v1/api-keys/:id.

TalePanel

Built by BitaceS · sudowl.com · Partner:HytaleTalk

Free forever · AGPL-3.0 · Not affiliated with Hypixel Studios. · Impressum · Datenschutz