cordyxRelaySign inGet started

Relay docs

Relay speaks ER:LC's API. If your bot works with ER:LC today, it works with Relay after you change the base URL and the key.

Getting started

  1. Sign in at relay.cordyx.xyz/app and add your server with its ER:LC server key.
  2. Make a key for each bot or developer and tick what it may do. Copy it straight away: Relay stores only a hash and can't show it again.
  3. Replace https://api.erlc.gg with https://relay.cordyx.xyz/api and use the Relay key.

To run commands, ER:LC also needs you to authorize Relay on your server once. The dashboard shows the link after you add a server.

Sending the key

Either header works. Use whichever needs fewer changes in your code.

Server-Key: cxr_…
Authorization: Bearer cxr_…

Relay keys start with cxr_ and are 44 characters long. Don't use them in browser code: anyone who opens the page can read them. Relay sends no CORS headers for that reason.

Endpoints

MethodPathPermission
GET/api/v1/serverserver.read
GET/api/v1/server/playersplayers.read
GET/api/v1/server/staffstaff.read
GET/api/v1/server/queuequeue.read
GET/api/v1/server/vehiclesvehicles.read
GET/api/v1/server/bansbans.read
GET/api/v1/server/joinlogslogs.join
GET/api/v1/server/killlogslogs.kill
GET/api/v1/server/commandlogslogs.command
GET/api/v1/server/modcallslogs.modcalls
POST/api/v1/server/commandthe command's group
GET/api/v2/serverserver.read, plus one per field
POST/api/v2/server/commandthe command's group

Anything else answers 404 with code 9007.

v2 fields

On GET /api/v2/server, each field you set to true needs its own permission. A field Relay doesn't know is refused, not ignored.

FieldPermission
Playersplayers.read
Staffstaff.read
Queuequeue.read
Vehiclesvehicles.read
JoinLogslogs.join
KillLogslogs.kill
CommandLogslogs.command
ModCallslogs.modcalls
EmergencyCallscalls.emergency

Commands

Relay reads the first word of the command and checks it against these groups. A command outside every group is refused for all keys.

PermissionGroupCommands
cmd.messageMessages:h :m :pm :log
cmd.moderationModeration:kick :ban :unban :kill :jail :unjail :wanted :unwanted
cmd.playersPlayer actions:heal :refresh :respawn :load
cmd.teleportTeleport:tp :bring :to
cmd.serverServer settings:prty :pt :weather :time :startfire :stopfire
cmd.staffStaff permissions:mod :unmod :admin :unadmin :helper :unhelper

Limits

Errors

Errors use ER:LC's shape, {"code": …, "message": "…"}. Codes from ER:LC pass through unchanged. Relay's own are in the 9000s.

CodeMeaning
9001No Relay key was sent.
9002That Relay key doesn't exist or was revoked.
9003This key isn't allowed to do that.
9004That command isn't one Relay knows, so it's refused.
9005This key can't be used from this IP address.
9006ER:LC refused this server's key. The owner needs to add a new one on the dashboard.
9007Relay doesn't proxy that endpoint.
9008This key has expired.

Examples

Python

import os, requests

r = requests.get(
    "https://relay.cordyx.xyz/api/v2/server",
    params={"Players": "true", "Queue": "true"},
    headers={"Server-Key": os.environ["RELAY_KEY"]},
)
print(r.json()["Players"])

curl

curl -X POST https://relay.cordyx.xyz/api/v1/server/command \
  -H "Authorization: Bearer $RELAY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"command": ":h Server restart in 10 minutes"}'