Endpoint Reference¶
This page lists every method on Client and AsyncClient, the PRC endpoint
each one calls, its full signature, return type, and common mistakes to avoid.
Use it as the definitive reference when you need a method's exact parameters.
For task-oriented examples (dashboards, logs, multi-server), see the
Endpoint Usage Cookbook.
All endpoint methods exist on both AsyncClient/AsyncERLC and
Client/ERLC. Async examples use await; sync examples remove await.
All endpoint methods accept:
server_key=to override the client default key.raw=Trueto return raw PRC data instead of typed models. Section helpers return their named raw section;server(raw=True)returns the full v2 payload.
Endpoint Version Map¶
| API area | PRC version | Wrapper methods |
|---|---|---|
| Server status and include sections | v2 | server, players, staff, queue, logs, vehicles, emergency_calls |
| Command execution | v2 | command |
| Bans | v1 | bans |
| Custom escape hatch | caller chooses | request |
v3 Convenience Map¶
| Need | Prefer |
|---|---|
| Dashboard-ready server state | api.bundle() |
| Every supported v2 server section | api.bundle("all") |
| Command logs | api.logs("command") |
| All log sections | api.logs("all") |
| No-HTTP command preview | api.preview_command(command, policy=policy) |
| Env-based client setup | Client.from_env() or AsyncClient.from_env() |
Support Matrix¶
| Capability | Support | Notes |
|---|---|---|
| Async client | Yes | AsyncERLC |
| Sync client | Yes | ERLC |
| Typed dataclasses | Yes | Default endpoint mode |
| Raw PRC data | Yes | raw=True |
| Default dynamic limiter | Yes | Process-local only |
| Optional global key header | Yes | global_key= sends Authorization |
| Event webhook verification | Optional extra | erlc-api.py[webhooks] |
| Discord library integration | No direct dependency | Use docs/templates and plain payload helpers |
| Distributed rate limiting/cache | Bring your own | Use external stores for multi-process deployments |
Method Table¶
| Method | Signature suffix | PRC endpoint | Default return type |
|---|---|---|---|
server |
(..., include=None, all=False, players=False, staff=False, join_logs=False, queue=False, kill_logs=False, command_logs=False, mod_calls=False, emergency_calls=False, vehicles=False) |
GET /v2/server |
ServerBundle |
bundle |
(request=None, *, include=None, exclude=None, server_key=None, raw=False) |
GET /v2/server |
ServerBundle |
players |
(*, server_key=None, raw=False) |
GET /v2/server?Players=true |
list[Player] |
staff |
(*, server_key=None, raw=False) |
GET /v2/server?Staff=true |
StaffList |
queue |
(*, server_key=None, raw=False) |
GET /v2/server?Queue=true |
list[int] |
join_logs |
(*, server_key=None, raw=False) |
GET /v2/server?JoinLogs=true |
list[JoinLogEntry] |
kill_logs |
(*, server_key=None, raw=False) |
GET /v2/server?KillLogs=true |
list[KillLogEntry] |
command_logs |
(*, server_key=None, raw=False) |
GET /v2/server?CommandLogs=true |
list[CommandLogEntry] |
mod_calls |
(*, server_key=None, raw=False) |
GET /v2/server?ModCalls=true |
list[ModCallEntry] |
emergency_calls |
(*, server_key=None, raw=False) |
GET /v2/server?EmergencyCalls=true |
list[EmergencyCall] |
vehicles |
(*, server_key=None, raw=False) |
GET /v2/server?Vehicles=true |
list[Vehicle] |
logs |
(kind, *, server_key=None, raw=False) |
GET /v2/server?... |
list or ServerLogs |
bans |
(*, server_key=None, raw=False) |
GET /v1/server/bans |
BanList |
preview_command |
(command, *, policy=None) |
none | CommandPreview |
command |
(command, *, server_key=None, raw=False, dry_run=False, policy=None) |
POST /v2/server/command |
CommandResult |
request |
(method, path, *, server_key=None, params=None, json=None, headers=None) |
any | raw decoded payload |
bundle¶
Signature:
await api.bundle(
request: str | Iterable[str] | BundleRequest | None = None,
*,
include: Iterable[str] | str | None = None,
exclude: Iterable[str] | str | None = None,
server_key: str | None = None,
raw: bool = False,
) -> ServerBundle
Purpose: fetch a named v2 include preset without remembering the long
server(...) flag list.
Examples:
dashboard = await api.bundle()
everything = await api.bundle("all")
ops = await api.bundle("dashboard", include="command_logs")
Default preset: dashboard, which includes players, staff, queue, vehicles,
and emergency calls.
logs¶
Signature:
Purpose: fetch log sections by simple kind names.
Accepted kinds:
join,joins,join_logskill,kills,kill_logscommand,commands,cmd,command_logsmod,mods,mod_callsall
logs("all") returns ServerLogs. Individual kinds return the same typed
lists as join_logs(), kill_logs(), command_logs(), and mod_calls().
server¶
Signature:
await api.server(
*,
server_key: str | None = None,
raw: bool = False,
include: Iterable[str] | str | None = None,
all: bool = False,
players: bool = False,
staff: bool = False,
join_logs: bool = False,
queue: bool = False,
kill_logs: bool = False,
command_logs: bool = False,
mod_calls: bool = False,
emergency_calls: bool = False,
vehicles: bool = False,
) -> ServerBundle
Purpose: fetch v2 server status and any requested v2 sections.
Minimal example:
bundle = await api.server(players=True, queue=True, staff=True)
print(bundle.name, bundle.players, bundle.queue, bundle.staff)
Important options:
all=Truerequests every v2 include section.include="players"orinclude=["players", "vehicles"]is equivalent to setting the matching booleans.- Include names accept underscores or hyphens, for example
join_logsorjoin-logs. include="all"is equivalent toall=True.
Common mistakes:
- Expecting
bundle.playersto be a list whenplayers=Truewas not requested. Optional sections areNoneunless requested. - Passing unknown include names. The client raises
ValueErrorbefore sending HTTP.
players¶
Signature:
Purpose: fetch and decode v2 players.
Minimal example:
players = await api.players()
for player in players:
print(player.name, player.user_id, player.team)
Common mistakes:
- Looking only at
player.player; useplayer.nameandplayer.user_idfor parsed values. - Assuming all optional PRC fields are present. Check for
None.
staff¶
Signature:
Purpose: fetch v2 staff maps.
Minimal example:
staff = await api.staff()
for member in staff.members:
print(member.role, member.name, member.user_id)
Common mistakes:
- Treating
StaffListas a plain list. Use.memberswhen you want flattened staff members.
queue¶
Signature:
Purpose: fetch queue user IDs in API order.
Minimal example:
Common mistakes:
- Assuming queue IDs are player names. The API returns user IDs.
join_logs¶
Signature:
Purpose: fetch v2 join/leave logs.
Minimal example:
Important options: pass raw=True if you need exact log keys from PRC.
Common mistakes:
- Treating
join=Trueas always present. Unknown or missing values decode asNone.
kill_logs¶
Signature:
Purpose: fetch v2 kill logs.
Minimal example:
Common mistakes:
- Assuming
weaponis a first-class field. Useentry.weapon()because PRC may expose it as extra payload data.
command_logs¶
Signature:
await api.command_logs(*, server_key: str | None = None, raw: bool = False) -> list[CommandLogEntry]
Purpose: fetch v2 command logs.
Minimal example:
from erlc_api.filter import Filter
warns = Filter(await api.command_logs()).command(name="warn").all()
Common mistakes:
- Manually parsing command names everywhere. Use
Filter(...).command(...),Grouper(...).command_name(), orAnalyzer(...).command_usage().
mod_calls¶
Signature:
Purpose: fetch v2 mod call logs.
Minimal example:
Common mistakes:
- Assuming every mod call has a moderator. Some calls may be unclaimed or incomplete.
emergency_calls¶
Signature:
await api.emergency_calls(*, server_key: str | None = None, raw: bool = False) -> list[EmergencyCall]
Purpose: fetch active v2 emergency calls.
Minimal example:
for call in await api.emergency_calls():
print(call.team, call.call_number, call.started_at_datetime())
Common mistakes:
- Assuming
calleris always an integer. The model acceptsint | str | Nonebecause PRC payloads can vary.
vehicles¶
Signature:
Purpose: fetch v2 spawned vehicles.
Minimal example:
from erlc_api.find import Finder
from erlc_api.vehicles import VehicleTools
vehicles = await api.vehicles()
vehicle = Finder(vehicles).vehicle(plate="ABC123")
summary = VehicleTools(vehicles).summary()
Common mistakes:
- Treating the API name as already normalized. Use
vehicle.model,vehicle.year,vehicle.normalized_plate, orfrom erlc_api.vehicles import VehicleToolsfor catalog-aware lookups.
bans¶
Signature:
Purpose: fetch server bans from the v1 endpoint that still owns this data.
Minimal example:
Common mistakes:
- Expecting this to use v2. The wrapper stays v2-first, but bans remain v1 because PRC has not replaced that endpoint.
command¶
Signature:
await api.command(
command: str | Command,
*,
server_key: str | None = None,
raw: bool = False,
dry_run: bool = False,
) -> CommandResult
Purpose: execute a PRC v2 command.
Minimal example:
from erlc_api import cmd
result = await api.command(cmd.pm("Player", "hello"))
print(result.success, result.message, result.command_id)
Important options:
dry_run=Truenormalizes and validates locally, then returns a local result without sending HTTP.raw=Truereturns the exact command response payload.CommandResult.command_idis populated fromcommandId,CommandId, orcommand_idwhen PRC includes a command tracking ID.
Common mistakes:
- Including newline characters in commands. The wrapper rejects them.
- Expecting the wrapper to maintain a hard-coded allowlist. It does not.
request¶
See Clients and Authentication for the low-level request signature and behavior.
Related Pages¶
Previous Page: Clients and Authentication | Next Page: Models Reference