Skip to main content

What is the Plugin API?

The Plugin API is the server-to-server API of your LeaderOS website. The official LeaderOS plugins (Minecraft, Hytale, FiveM, Rust, ARK, Unturned, Garry’s Mod, CS2) and the Discord bot talk to your site through it. You can use it too, to write your own plugin, bot or backend integration.

In-game login and registration

Authenticate players in game with their website account, register them, check 2FA codes.

Store and credits

In-game store menus, buying with credits, adding/removing/sending credits.

Command delivery

Run the commands of purchased products on your game server with LeaderOS Connect.

Discord and support

Discord role syncing, support tickets, AI commands.

Plugin API vs Headless API

The Plugin API key has admin power: it can change any player’s credits, give roles and make purchases. Never use it in browser code, a mobile app, a public repository or a file you hand out to players. Keep it on the server only.

Basics

  • Base URL: https://your-site.com/api
  • Authentication: the X-Api-Key: <api key> header on every request
  • Request body: application/x-www-form-urlencoded (or multipart/form-data). JSON bodies are not validated; send form data.
  • Arrays: sent as form arrays, e.g. commands[]=15&commands[]=16, products[0][id]=12&products[0][quantity]=1

Response format

Endpoints that perform an action return this envelope:
On a validation error, error is VALIDATION and message is a list of messages:
Some read endpoints (e.g. GET /store/products, GET /users, GET /credits) return the object or array directly, without the envelope. The API reference shows the response shape of every endpoint.
Always branch on the error code, not on message.

HTTP status codes

Endpoints

See the API reference group on the left for every parameter and response.

Where to start

1

Enable the API

Turn on the API in the panel and get your key → Setup
2

Write your own integration

Start with the sample requests → Usage examples