Introduction

The PRL API lets verified servers submit moderation events and query the shared reputation database. Base URL: https://lookup.crunchbyte.org/api

Write endpoints require a verified server with an API key and secret. Read endpoints (player lookup, search, stats) are public.

The prl-client FiveM resource handles authentication and signing automatically. You only need the raw API for custom integrations.

Authentication

Write endpoints require these headers on every request:

HeaderValue
X-Api-KeyYour API key - starts with prl_
X-SignatureHMAC-SHA256 of the request body using your secret
X-NonceUnique per-request string - UUID or timestamp+random

API keys and secrets are generated in Server Settings. The secret is never sent in requests - only used locally to compute the signature.

Reputation tiers

Players start at score 100. Events lower the score. Revocations restore the delta of the original event.

CLEAN
80-100
CAUTION
60-79
WARNING
40-59
DANGER
0-39

Score deltas: BAN -30, KICK -10, WARN -5.

Submit moderation event

POST/api/moderation/submit

Records a ban, kick, warn, or note against a player. Requires a verified server and HMAC auth.

Request body

FieldTypeRequiredDescription
player_idstringrequiredPRL UUID for the player.
typestringrequiredBAN, KICK, WARN, or NOTE
reasonstringrequiredHuman-readable reason.
moderator_idstringrequiredDiscord ID or identifier of the moderator.
timestampISO 8601optionalWhen the action occurred. Defaults to now.
identitiesobjectoptionalAdditional identifiers: discord, fivem_license, rockstar_id, steam, alias
revokes_event_idstringoptionalEvent ID to revoke (use with type: NOTE).
Example request
POST /api/moderation/submit
X-Api-Key: prl_xxxxxxxxxxxx
X-Signature: <hmac-sha256-hex>
X-Nonce: a1b2c3d4-e5f6
Content-Type: application/json

{
  "player_id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "BAN",
  "reason": "Cheating - aimbot detected",
  "moderator_id": "123456789012345678",
  "identities": {
    "discord": "123456789012345678",
    "fivem_license": "license:abc123def456"
  }
}
Response
{
  "success": true,
  "event_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "idempotent": false
}

Player lookup

GET/api/player/:identifier

Returns player profile by any known identifier. Public - no authentication required. Note: moderator_id fields are redacted in unauthenticated responses. Log in with Discord to see them.

FormatExample
PRL UUID550e8400-e29b-41d4-a716-446655440000
discord:IDdiscord:123456789012345678
fivem_license:hashfivem_license:abc123def456
rockstar_id:idrockstar_id:1234567890
steam:hexsteam:1100001xxxxxxx

Server info

GET/api/server/:guild_id

Returns registration and verification status. Requires a Discord OAuth session.

Global stats

GET/api/stats

Returns public network-wide counters, cached for 60 seconds.

Response
{
  "verified_servers": 12,
  "players_tracked": 8432,
  "moderation_events": 1621
}

HMAC signing

Compute HMAC-SHA256 over the raw JSON body using your API secret as the key. Hex-encode the result.

Never send your API secret in a request. It is used only locally to compute the signature.

Node.js

const crypto = require('crypto');

function sign(secret, body) {
  const payload = typeof body === 'string' ? body : JSON.stringify(body);
  return crypto.createHmac('sha256', secret).update(payload).digest('hex');
}

headers['X-Signature'] = sign(apiSecret, requestBody);
headers['X-Nonce']     = crypto.randomUUID();

Python

import hmac, hashlib, json, uuid

def sign(secret, body):
    payload = json.dumps(body, separators=(',', ':'))
    return hmac.new(secret.encode(), payload.encode(), hashlib.sha256).hexdigest()

headers = {
    'X-Api-Key':   api_key,
    'X-Signature': sign(api_secret, body),
    'X-Nonce':     str(uuid.uuid4()),
}

Lua (FiveM)

-- prl-client handles this automatically via server/hmac.lua
-- Manual call:
local signature = PRL.HMAC(PRL.Config.ApiSecret, requestBody)

FiveM resource

The prl-client resource is the fastest integration path - it hooks txAdmin events automatically with zero extra code.

Installation

1. Download prl-client.rar from your dashboard
2. Extract to resources/prl-client/
3. Edit config.lua with your API key and secret
4. Add to server.cfg:   ensure prl-client
5. Restart and run /prltest in-game to confirm

Manual exports

exports['prl-client']:SubmitBan(playerId, reason, moderatorId)
exports['prl-client']:SubmitKick(playerId, reason, moderatorId)
exports['prl-client']:SubmitWarn(playerId, reason, moderatorId)