Essential & Pro feature

The fiveapply FiveM resource & whitelist API

A small, server-side-only Lua resource that asks FiveApply whether a connecting player is approved. It's an alternative to the txAdmin role check — use one or the other.

Install

  1. In your community dashboard, open In-game & API and create an API key. Copy it — it's shown once.
  2. Download the resource folder resources/fiveapply from your FiveApply install (or the release zip) into your server's resources/ directory.
  3. Add to server.cfg:
ensure fiveapply
set fa_api_key "fa_live_xxxxxxxxxxxxxxxxxxxxxxxx"
set fa_api_url "https://fiveapply.com/api/v1"
# Let players in if the API can't be reached (true) or keep them out (false)
set fa_fail_open "true"
# Cache results for this many seconds
set fa_cache_ttl "60"

Keep the API key secret — set (not sets/setr) keeps it server-side.

What it does

  • Hooks playerConnecting with deferrals and reads the player's discord: and license: identifiers.
  • Calls the API, caches the answer in memory for fa_cache_ttl seconds.
  • Rejects non-whitelisted players with a friendly message that includes your apply link.
  • Records Cfx licenses against the applicant so staff can see alt accounts sharing a license.
  • If the API is down, applies your fail-open / fail-closed choice.

API reference

GET /api/v1/whitelist/check

Headers: Authorization: Bearer fa_live_…

Query: discord (required, user ID), optional license, license2, fivem, steam, xbl, live.

{
  "allowed": true,
  "reason": "approved",          // approved | not_approved | no_application | blocked | no_discord
  "status": "approved",
  "message": "Welcome back!",
  "apply_url": "https://fiveapply.com/c/your-community",
  "took_ms": 3.1
}

Errors: 401 invalid_api_key, 402 plan_required, 429 rate_limited (1,200 requests/min per key).

GET /api/v1/health

Unauthenticated uptime check: {"ok":true,"database":true,"worker":true}.