> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.eraus.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# ER:LC compatibility

> Use tools built for the ER:LC API with ERA by changing the base URL.

ERA also serves the [ER:LC API](https://apidocs.erlc.gg) shapes under `/prc`. The paths, the `Server-Key` header, field names, timestamps and error codes all match. Code written for ER:LC works once you point it at ERA.

| ER:LC | ERA |
| - | - |
| `https://api.policeroleplay.community/v1/...` or `https://api.erlc.gg/v1/...` | `https://api.eraus.gg/prc/v1/...` |
| `https://api.erlc.gg/v2/...` | `https://api.eraus.gg/prc/v2/...` |
| `Server-Key: <ER:LC key>` | `Server-Key: <ERA key>` |

```bash theme={null}
curl "https://api.eraus.gg/prc/v2/server?Players=true&Vehicles=true" \
  -H "Server-Key: era_k3j9x0abq2mn_..."
```

Tools that also send an ER:LC app key in `Authorization` keep working. ERA uses whichever header holds an ERA key and ignores the other.

## Endpoints

| Method | Path | Notes |
| - | - | - |
| GET | `/prc/v1/server` | `Name`, `OwnerId`, `CoOwnerIds`, `CurrentPlayers`, `MaxPlayers`, `JoinKey`, `AccVerifiedReq`, `TeamBalance` |
| GET | `/prc/v1/server/players` | `Player` (`name:id`), `Permission`, `Callsign`, `Team`, `WantedStars`, `Location` |
| GET | `/prc/v1/server/staff` | `CoOwners`, `Admins`, `Mods`, `Helpers` |
| GET | `/prc/v1/server/joinlogs` | Newest 100 |
| GET | `/prc/v1/server/killlogs` | Newest 100 |
| GET | `/prc/v1/server/commandlogs` | Newest 100 |
| GET | `/prc/v1/server/modcalls` | Newest 100 |
| GET | `/prc/v1/server/bans` | `{ "userId": "username" }` |
| GET | `/prc/v1/server/vehicles` | `Name`, `Owner`, `Plate`, `Texture`, `ColorHex`, `ColorName` |
| GET | `/prc/v1/server/queue` | Always `[]`, because ERA servers don't have a queue |
| POST | `/prc/v1/server/command` | `{ "command": ":h Hello" }` returns `{ "message": "Success" }` |
| GET | `/prc/v2/server` | Add `Players`, `Staff`, `JoinLogs`, `Queue`, `KillLogs`, `CommandLogs`, `ModCalls`, `EmergencyCalls` or `Vehicles` as `=true` to include them |
| POST | `/prc/v2/server/command` | Same as v1 |

## Where ERA differs

> [accordion] Commands
>
> Only [ERA's approved commands](https://apidocs.eraus.gg/commands.md) can run, not every ER:LC command. `:h`, `:m` and `:n` all map to `:announce`. Unknown commands answer with code `4002` (restricted). `Success` means the command was **accepted**, not that it has run. Native `/v1/server/commands` gives you an id to check the result.

> [accordion] Permissions
>
> `Server Owner` is the owner. `Server Administrator` is any rank at or above the server's Server Manager rank. Every other staff rank is `Server Moderator`. ERA has no co-owners or helpers, so `CoOwnerIds` is always `[]` and `Helpers` is always `{}`.

> [accordion] Location
>
> `LocationX` and `LocationZ` are in-game studs. `PostalCode` and `StreetName` come from ERA's postal map. `BuildingNumber` is always empty. See [Map](https://apidocs.eraus.gg/map.md) to plot positions.

> [accordion] Emergency calls
>
> `EmergencyCalls` lists the live MDT calls: 000 calls and automatic alerts. `Caller` is `0` for alerts. `Players` holds the user IDs of units responding. `Team` is the service the call went to.

> [accordion] Vehicles
>
> `Texture` is always `null`, because ERA cars don't have liveries. `ColorName` and `ColorHex` are the car's paint.

> [accordion] Joins, command logs and AccVerifiedReq
>
> `AccVerifiedReq` is always `"Disabled"`. API commands show up in `commandlogs` as `Remote Server (<key name>):0`.

> [accordion] Rate limits and errors
>
> The headers match ER:LC's: `X-RateLimit-Bucket`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` as a Unix timestamp. Errors use ER:LC's `{ "code", "message" }` shape and numbers, such as `2002` for a bad key, `3002` (HTTP 422) for an offline server and `4001` for rate limited.

If you're building something new, use the [native API](https://apidocs.eraus.gg/api/server.md) instead. It has command results, cursors for logs, webhooks, structured fields and clearer errors.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.