🔐API Endpoints
Endpoints marked with the Required
tag must be integrated into your resource to ensure proper compatibility.
Recurring
Required: Periodic Server Update
POST
https://staffwatch.app/api/updateServer
Sends up-to-date information to StaffWatch regarding the players on the server. In order to ensure that the information on the panel is up-to-date, we recommend this endpoint be executed every 5-10 seconds.
This endpoint also returns something referred to as the command queue (see below). When RCON commands fail (or when a user has RCON disabled), commands are sent to this queue and should be executed immediately as they are deleted once this endpoint is executed.
Request Body
Name | Type | Description |
---|---|---|
secret* | String | The server's secret access key. |
data* | Object | A JSON array containing dictionaries of player identifiers. At minimum, you must provide a name and primary ID (this depends on the game, for GTA, this is the users Rockstar license). You may also optionally include the players Example:
|
Events
Required: Player Join Event
POST
https://staffwatch.app/api/playerJoin
This endpoint must be triggered every time a player attempts to join the server. It will add them to the player database if they are not already in it, update their player identifiers, and finally return a JSON object providing information regarding if they should be allowed to join the server.
Request Body
Name | Type | Description |
---|---|---|
identifiers* | object | A JSON dictionary containing all of a players identifiers such as Steam, Discord, and HWID. The players primary identifier must be provided! |
name* | string | The player's name inside the server. |
secret* | String | The server's secret access key. |
Provides information about player's join request. The canJoin
variable should be used to determine if the user is permitted to join the server, or their connection should be disconnected. The newPlayer
variable determines if this is a players first time being logged on the server. The banned
variable, and accompanying information, only appear if the player is currently banned from the server. The appealCode
can be used by the player on https://staffwatch.app/appeal to appeal the ban.
Permissions
Check User Staff Status
POST
https://staffwatch.app/api/isStaff
Checks if a player is registered as a staff member in the online panel. This function relies on Claiming a Player in order to work properly! This is automatically performed for staff actions such as commend/warn/kick/ban but this endpoint can be useful if you want to integrate your own commands such as teleport/summon/freeze/etc.
Request Body
Name | Type | Description |
---|---|---|
secret* | String | The server's secret access key. |
player_identifier* | String | The players primary identifier, as defined in the game selected in the server settings of the panel. If your game uses |
Commands
Required: Remote Actions (commend/warn/kick/ban)
POST
https://staffwatch.app/api/remoteAction
Request Body
Name | Type | Description |
---|---|---|
key* | String | The identifier type to use to perform action, such as |
type* | String |
|
secret* | String | The server's secret access key. |
staff* | String | The primary identifier of the staff member performing the action. |
player* | String | The primary identifier of the player receiving the action. |
reason* | String | The reason for the staff action. |
duration* | String | The duration of the ban (if applicable). Example: " |
Report Player
POST
https://staffwatch.app/api/reportPlayer
Players can report other players in-game and these reports will be sent to the server dashboard for staff members to investigate. This endpoint is generally mapped to a /report
command in-game.
Request Body
Name | Type | Description |
---|---|---|
secret* | String | The server's secret access key. |
reporter_primary* | String | The primary identifier of the player filing the report. |
reported_primary* | String | The primary identifier of the player being reported. |
reason* | String | The reason the player is being reported. |
Get Trust Score
POST
https://staffwatch.app/api/getTrust
Gets a players trust score, this could be used for a /trustscore
command but could also be used for many other actions. Value will be between 0-100 and is based off a variety of things including staff actions against the player, length of time on server, etc.
Request Body
Name | Type | Description |
---|---|---|
secret | String | The server's secret access key. |
player_identifier | String | The players primary identifier, as defined in the game selected in the server settings of the panel. If your game uses |
Generate Player Profile Access Key
POST
https://staffwatch.app/api/generate-profile-access-key
Players can access their profile by visiting https://staffwatch.app/appeal and entering their access key. This endpoint generates a temporary access key a player can use to view their profile. Generally this would be used for a /profile
command in-game.
Request Body
Name | Type | Description |
---|---|---|
secret* | String | The server's secret access key. |
player_identifier* | String | The players primary identifier, as defined in the game selected in the server settings of the panel. If your game uses |
Miscellaneous
Create In-Game Log
POST
https://staffwatch.app/api/log
Create a log that will be displayed in either Server Logs or Event Log depending on the name provided. Generally server logs include chat messages and commands, while event logs include deaths, player join and leave events, etc.
Request Body
Name | Type | Description |
---|---|---|
event_name* | String |
|
event_content* | String | The data of the event. HTML attributes such as <b> and <a href> may be used. |
Last updated