Documentation / API and webhooks
Account and billing
Eytak API tokens and webhooks: scopes, events, signatures
Create scoped API tokens in the panel, call the API with a Bearer header, and receive signed webhooks for server, health and backup events.
Eytak has an API for scripts and integrations. You authenticate with an API token that you create in the panel and limit to the permissions it needs, and you can have Eytak send a signed HTTP request to your own endpoint when something happens on a server. This page covers both: how to make a token, what the scopes mean, which webhook events exist, and how to verify a delivery.
Tokens and webhooks belong to a workspace, so they follow the roles described in teams and workspaces.
Create an API token
- Open Settings in the panel and choose the API Tokens tab.
- Click Create token and give it a name that says what uses it, such as "CI deploy".
- Under Permissions, tick the read or write boxes you need. You must pick at least one.
- Optionally set Expires in (days). Leave it empty and the token does not expire.
- Create it, then copy the token straight away. It is shown once. If you lose it, revoke it and make a new one.
The list on that tab shows each token's status (active, revoked or expired), when it expires and when it was last used. Revoke removes one token immediately and leaves your other tokens alone. Any integration using the revoked token loses access at once, and a revoke cannot be undone.
Creating tokens needs an admin or owner role, and you have to be signed in to the panel to do it. A token cannot create other tokens.
Scopes
Each resource has a read scope and a write scope:
- servers:
servers:read,servers:write - billing:
billing:read,billing:write - team:
team:read,team:write - support:
support:read,support:write - webhooks:
webhooks:read,webhooks:write
Give a token the smallest set that works. A script that only reports on your servers needs servers:read and nothing else.
A scope says what the token may be used for. It does not lift the role of the person who made it. A token acts with its creator's current role in the workspace, so if that person is demoted, the token can do less too. Only the workspace owner can create a token with billing:write.
Call the API
Send the token as a Bearer token in the Authorization header. Tokens start with ctk_:
Authorization: Bearer ctk_your_token_hereAn invalid, revoked or expired token gets a 401. A valid token that lacks the scope for the call gets a 403 that names the missing scope. Treat a token like a password: keep it out of source control and chat messages.
Webhooks
A webhook sends a POST to a URL you control when an event happens. Set one up in Settings → Webhooks:
- Click Add endpoint.
- Enter the Endpoint URL. It must be an
httpsaddress on the public internet. Internal hostnames and private addresses are refused. - Enter a Signing secret of at least 16 characters, or use Generate.
- Under Events, tick the ones you want. Leave everything unselected to receive all events.
Creating and deleting endpoints needs an admin or owner role.
Events
The panel groups events into Server, Health and Backups. These are the only events Eytak sends.
- Server:
server.start.requested,server.stop.requested,server.restart.requested,server.command.executed,server.port.opened,server.port.closed - Health:
server.crashed,server.boot.stalled,server.memory.high,server.lagging,server.log.flooding,server.slept,server.player.refused,server.player.joined - Backups:
server.backup.requested,server.backup.completed,server.backup.failed,server.backup.restore.requested,server.backup.restored,server.backup.restore.failed
The start, stop and restart events mean a request was made, from the panel or the API, not that the server has finished changing state. Some events carry extra fields, for example server.backup.completed includes the size and server.lagging includes a likely cause.
What a delivery looks like
Each delivery is a JSON POST with an id, an eventType, a payload and a timestamp. Three headers come with it:
x-eytak-signature: an HMAC-SHA256 of the raw request body, hex encoded, using your signing secret.x-eytak-event: the event name.x-eytak-delivery: the delivery id.
To verify a delivery, compute the HMAC of the exact bytes you received with your secret and compare it to the signature header. Reject the request if they differ. Use the x-eytak-delivery id to ignore a repeat if you see the same one twice.
Retries and the delivery log
Your endpoint has 10 seconds to answer with a success status. Redirects are not followed and count as a failure. A failed delivery is retried with growing delays, and after several attempts it is marked failed. Expand an endpoint's Deliveries list in the panel to see what was sent and how your server answered.
For alerts that go to Discord or email rather than your own code, see notifications.
Troubleshooting
"Missing required scope". The token was created without that scope. Create a new token that includes it.
The endpoint is refused when I add it. It is probably not https, or the host is internal or resolves to a private address. Use a public https URL.
Signatures never match. Hash the raw body bytes before any JSON parsing, and make sure you use the same secret you entered. A stray space in the secret is a common cause.
A token stopped working. It may have expired or been revoked, or its creator's role may have been reduced. Check its status on the API Tokens tab.
Frequently asked questions
Can I limit an API token to read-only access?
Yes. Choose only the read boxes when you create the token. Each resource has separate read and write permissions.
Is an API token shown again after I create it?
No. The full token is displayed once, when you create it. If you lose it, revoke it and create a new one.
How do I verify that a webhook came from Eytak?
Compute an HMAC-SHA256 of the raw request body with your signing secret, hex encode it, and compare it with the x-eytak-signature header.
Which events can webhooks send?
Server start, stop and restart requests, console commands, port changes, crashes, stalled boots, high memory, lag, sleep, player events, and backup and restore events. Eytak does not list events it cannot send.
Are failed webhook deliveries retried?
Yes. A failed delivery is retried several times with growing delays before it is marked failed, and the delivery log in the panel shows each result.