Skip to content

shiva-api — Endpoints

All endpoints are prefixed with /api/v1. Requires Authorization: Bearer <token>.

Players

GET /api/v1/players

List all online players.

Response:

json
{
    "players": [
        { "serverId": 1, "name": "John Doe", "job": "police", "ping": 45 }
    ]
}

GET /api/v1/players/:id

Get player data by server ID or license.

POST /api/v1/players/:id/notify

Send a notification to a player.

Body: { "type": "info", "message": "Hello from the API!" }

Economy

GET /api/v1/players/:id/accounts

Get all accounts for a player.

POST /api/v1/players/:id/accounts/:account/add

Add money to an account.

Body: { "amount": 1000 }

POST /api/v1/players/:id/accounts/:account/remove

Remove money from an account.

Jobs

POST /api/v1/players/:id/job

Set a player's job.

Body: { "job": "police", "grade": 2 }

Server

GET /api/v1/server/status

Get server status, player count, and uptime.

POST /api/v1/server/broadcast

Send a notification to all players.

Released under the MIT License.