PRC Private Server API
  • â„šī¸API Information
    • 👋Introduction
    • âš–ī¸API Use Guidelines
  • đŸ› ī¸For Developers
    • 📚API Reference
    • 🚨Rate Limits
    • 🚧Error Codes
    • ❓Global API Key Request
  • đŸ“ĸFor the public
    • â˜„ī¸Intro to the API
Powered by GitBook
On this page
  1. For Developers

API Reference

PreviousAPI Use GuidelinesNextRate Limits

Last updated 2 months ago

Base URL: https://api.policeroleplay.community/v1

All requests should be sent with authentication headers:

Header Name
Description
Required

Server-Key

Server-Key, obtained in-game from private server settings

On all /server/ requests

Authorization

Global API key.

You will only have a global API key if your application has been approved for increased rate limits!

Not required

  • All requests must start with the base URL.

  • Listed code examples in this section are not up to date due to issues with our documentation site, please only use this as a reference. If you do not know how to code without examples, the API is not for you - use a pre-made bot.

Please be aware of higher rate-limits on all POST routes. Respect the rate limit headers!

Resetting a global API key:

If you were issued a global API key, you can reset it by sending a POST to /v1/api-key/reset with the "authorization" header set as your API key. This will send a new key which can only be viewed once. If you lose the key, the person who requested the API key must contact PRC.

đŸ› ī¸
📚

Fetches server status

get
Authorizations
Responses
200
Server status data
application/json
403
Unauthorized
get
GET /server HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Accept: */*
{
  "Name": "API Test",
  "OwnerId": 1,
  "CoOwnerIds": [
    1
  ],
  "CurrentPlayers": 1,
  "MaxPlayers": 1,
  "JoinKey": "APIServer",
  "AccVerifiedReq": "Disabled / Email / Phone/ID",
  "TeamBalance": true
}

Fetches players in server

get
Authorizations
Responses
200
Players in server
application/json
403
Unauthorized
get
GET /server/players HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Accept: */*
[
  {
    "Player": "PlayerName:Id",
    "Permission": "Normal / Server Administrator / Server Owner / Server Moderator",
    "Callsign": "The player's callsign - only available if the player is on a non-civilian team",
    "Team": "The player's team "
  }
]

Fetches join logs

get
Authorizations
Responses
200
Join logs data
application/json
403
Unauthorized
get
GET /server/joinlogs HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Accept: */*
[
  {
    "Join": true,
    "Timestamp": 1704614400,
    "Player": "PlayerName:Id"
  }
]

Fetches players in queue

get
Authorizations
Responses
200
Players in queue (by Roblox id)
application/json
Responseinteger[]
403
Unauthorized
get
GET /server/queue HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Accept: */*
[
  1
]

Fetches kill logs

get
Authorizations
Responses
200
Kill logs data
application/json
403
Unauthorized
get
GET /server/killlogs HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Accept: */*
[
  {
    "Killed": "PlayerName:Id",
    "Timestamp": 1704614400,
    "Killer": "PlayerName:Id"
  }
]

Fetches command logs

get
Authorizations
Responses
200
Command logs data
application/json
403
Unauthorized
get
GET /server/commandlogs HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Accept: */*
[
  {
    "Player": "PlayerName:Id",
    "Timestamp": 1704614400,
    "Command": ":h"
  }
]

Fetches moderator call logs

get
Authorizations
Responses
200
Moderator call logs data. 'Moderator' is only sent if a mod has responded to the call.
application/json
403
Unauthorized
get
GET /server/modcalls HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Accept: */*
[
  {
    "Caller": "PlayerName:Id",
    "Moderator": "PlayerName:Id",
    "Timestamp": 1704614400
  }
]

Fetches bans

get
Authorizations
Responses
200
Bans data
application/json
403
Unauthorized
get
GET /server/bans HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Accept: */*
{
  "PlayerId": "PlayerName"
}

Fetches a list of spawned vehicles in the server

get
Authorizations
Responses
200
Vehicles in the server
application/json
403
Unauthorized
get
GET /server/vehicles HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Accept: */*
[
  {
    "Texture": "Standard",
    "Name": "2019 Falcon Interceptor Utility",
    "Owner": "flat_bird"
  }
]
  • GETFetches server status
  • GETFetches players in server
  • GETFetches join logs
  • GETFetches players in queue
  • GETFetches kill logs
  • GETFetches command logs
  • GETFetches moderator call logs
  • GETFetches bans
  • GETFetches a list of spawned vehicles in the server
  • POSTRun a command as a player named "virtual server management"

Run a command as a player named "virtual server management"

post
Authorizations
Body
commandstringOptional

The command to be executed

Example: :h Hey everyone!
Responses
200
Command executed successfully
400
Bad request
403
Unauthorized
422
The private server has no players in it
500
Problem communicating with Roblox
post
POST /server/command HTTP/1.1
Host: 
authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 30

{
  "command": ":h Hey everyone!"
}

No content