Getting Started
Authentication
NoxAeApi authenticates requests with a single key header. Whether it is required depends on the server operator's configuration.
The key header
Every endpoint accepts an optional key header. In OpenAPI terms this is an apiKey scheme named ApiKeyAuth, sent in: header.
Header
key: YOUR_API_KEYIf the operator has enabled require-key, requests without a valid key are rejected. Otherwise the header is ignored.
Example
Send the header with every request:
curl
curl https://mc.example.com/v1/server \
-H "key: YOUR_API_KEY"JavaScript
const res = await fetch("https://mc.example.com/v1/server", {
headers: { key: process.env.NOXAE_API_KEY },
})
const server = await res.json()Security best practices
- Never expose the key client-side. The key grants full server control. Keep requests on a trusted backend and store the key in an environment variable or secret manager.
- Whitelist trusted IPs. Restrict the API port to the IP addresses of your backend or automation hosts.
- Serve over HTTPS. Terminate TLS with a reverse proxy so keys are never sent in cleartext.
- Rotate keys. Change the key if you suspect it has leaked, and use distinct keys per integration where possible.
Treat the key like a root password
Anyone with the key can run console commands, ban players, and restart the server. Guard it accordingly.