# Home

This guide assumes that you have already invited RoleplayBot to your discord server and that you have a basic understanding of discord.

{% hint style="info" %}
**Documentation last updated for version 3.0.91**
{% endhint %}

## Welcome To RoleplayBot's Documentation

Throughout this documentation you will learn how to use RoleplayBot to its full potential, enhance roleplay inside your community and keep up with the latest features. RoleplayBot can be configured to fit almost all roleplay communities, with a range of commands and the option to disable certain modules to keep you in control.\
\
If you have never used RoleplayBot before, it must be configured correctly to unlock every feature, take a look at our configuration section for more information!

{% content-ref url="/pages/RjiBMK8T9ZRzT8PewzZF" %}
[Configuration](/info/config)
{% endcontent-ref %}

If you are looking to use RoleplayBot's Powerful API to develop a project of your own then check out the API Documentation.

{% hint style="warning" %}
The API was unfortunately removed from RoleplayBot in version 3.0.0.
{% endhint %}

{% content-ref url="/pages/HIYJTU2lsWW3eIhFyrJZ" %}
[API Introduction](/api/introduction)
{% endcontent-ref %}

### What Are you waiting For? Lets get started

Take a look at our handy information and setup guides listed below.

{% content-ref url="/pages/RjiBMK8T9ZRzT8PewzZF" %}
[Configuration](/info/config)
{% endcontent-ref %}

{% content-ref url="/pages/TvEJdvZIF2kcleZzgWha" %}
[Permissions](/info/permissions)
{% endcontent-ref %}

{% content-ref url="/pages/qduSm6iAWkYYWOl93odc" %}
[Getting Started](/info/start)
{% endcontent-ref %}


# Configuration

Configure your server to unlock the maximum ability of RoleplayBot.

## Server Configuration

To use RoleplayBots interactive commands you must first configure your server. You can do this simply by running the command `/config server`  inside your Discord server and filling out the options. Once you have typed the command you will be prompted to fill in 13 different options, 4 roles and 9 channels.&#x20;

This may seem overwhelming at first, we have broken down each option below to see exactly what you need to enter.

<figure><img src="https://3166164597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdRTUkNUPApfD0yd81MsB%2Fuploads%2FmIsGn4xKqtNhIlcS2fQS%2Fchrome_0F89LL3bnj.gif?alt=media&amp;token=c2791326-e6db-4848-a5f0-b1b8612921b5" alt=""><figcaption></figcaption></figure>

### Roles (Options 1 -> 4)

RoleplayBot uses these roles to restrict and manage certain commands and modules. For example, the **On Duty** role restricts civilian members from performing law enforcement actions with the bot. Subsequently, the law enforcement role restricts civilian members from going **On Duty**.

* `on_duty` - This is a **role** that people will be given upon using the `/on_duty` command as either a police officer, firefighter or medic. We recommend you create a new role called **On Duty** for this option. For RoleplayBot to access this role you must ensure that you place the **@On Duty** role below the **@RoleplayBot** role inside the role hierarchy menu. See the image below for a visual representation of what this looks like. **Important** **Note:** RoleplayBot handles the On Duty role. Make sure this is a new, empty role with no special permissions that no members already have.
* `law_enforcement` - This is a role that people require to access any law enforcement commands. We recommend you create a role called **Law Enforcement** or enter a role that all law enforcement members have for this option.
* `fire_department` - This is a role that people require to access any fire department **and medical** commands. We recommend you create a role called **Fire Department** or enter a role that all fire department members have for this option.&#x20;
* `medical` - This is a role that people require to access any medical commands. We recommend you create a role called **Medical** or enter a role that all medical members have for this option.&#x20;

<figure><img src="https://3166164597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdRTUkNUPApfD0yd81MsB%2Fuploads%2Fblt3Y72PTZOGSRVT2vTC%2Fj91N6kGGRh.png?alt=media&amp;token=ea47c019-1d07-4664-8647-a1a3456374c8" alt=""><figcaption><p>This shows the Discord role hierarchy found inside the server role settings. Make sure that <strong><code>RoleplayBot</code></strong> is above all roles mentioned above.</p></figcaption></figure>

### **Channels (Options 5 -> 12)**

RoleplayBot will use these channels to sent alerts or messages. Members do not need permission to message inside these channels, guide permission levels are provided for each channel.

* `emergency_calls` - This is a channel where all 9-1-1 and 3-1-1 calls will be sent. We recommend that you create a channel called **emergency\_calls** and allow all **On Duty** members to view the channel.
* `panic_alerts` - This is a channel where all panic and PASS ([What is a PASS?](https://en.wikipedia.org/wiki/PASS_device)) alerts will be sent. We recommend that you create a channel called **panic\_alerts** and allow all **On Duty** members to view the channel.
* `jail_admissions` - This is a channel where all jail admissions will be sent. We recommend that you create a channel called **jail\_admissions** and allow all members to view the channel.
* `hospital_admissions` - This is a channel where all hospital admissions will be sent. We recommend that you create a channel called **hospital\_admissions** and allow all members to view the channel.
* `twitter_channel` - This is a channel where all tweets will be sent. We recommend that you create a channel called **twitter** and allow all civilians to view the channel. [What is Twitter (X)?](https://x.com) -> RoleplayBot is aware that Twitters name has changed to X, we have no plans to follow this change.
* `tor_channel` - This is a channel where all anonymous TOR posts will be sent. We recommend that you create a channel called **tor** and allow all civilians to view the channel. [What is TOR?](https://www.torproject.org/)
* `police_logs` - This is a channel where all citations, fines, impounds and BOLOs will be sent. We recommend that you create a channel called **police\_logs** and allow all law enforcement members to view the channel.
* `civilian_logs` - This is a channel where all civilian character actions will be sent (Character created, deleted, edit, etc). We recommend that you create a channel called **civilian\_logs** and allow only server administrators to view the channel.
* `economy_logs` - This is a channel where all economy actions will be sent (Money withdrew, deposited, paid, items bought, etc). We recommend that you create a channel called **economy\_logs** and allow only server administrators to view the channel.

## Economy Configuration

To avoid confusion, you must configure the servers economy using a separate command. This is done is a very similar way to the server configuration, use the command `/config economy`.

* `starting_balance` - This is the amount of money everyone will receive when interacting with the economy for the first time.

{% hint style="info" %}
Starting balance is now added to a users bank account when they first interact with any aspect of the economy module, rather than when they join the server.
{% endhint %}

## Disable & Enable Modules

To disable and restrict everyone from using certain modules you can run the `/disable module` command.

To re-enable a disabled module you can run the `/enable module` command.

## Deleting Configurations

If your having trouble with your configurations or simply want to delete/reset them you can use the provided **/delete\_config** command.

{% hint style="info" %}
You are unable to edit your server configuration. To change a role, channel or setting you must first delete the configuration (/delete\_config) and then reconfigure. No other data is lost during this process.
{% endhint %}


# Permissions

The base permissions required for RoleplayBot to work correctly inside your server.

## Required Permissions

RoleplayBot requires the following permissions in every channel inside your server, we recommend adding the permission to the RoleplayBot role or providing the bot with a role that meets these permissions. Alternatively, to eliminate any problems with permissions you can provide the bot with **Administrator**.

* Manage Messages
* Send Messages
* Embed Links
* Attach Files
* Manage Roles
* View Channels
* Manage Channels
* Connect
* Speak
* Mention Everyone
* Use Slash Commands
* Use Voice Activity
* Use External Emojis


# Getting Started

A very basic quick start guide to RoleplayBot.

### Creating A Civilian Character

Now onto commands, first we are going to start by creating a civilian character. To do this you first must ensure that your guild is configurated (More information [here](/info/config#guild-configuration)). Now run the command `/civilian create` and fill in the provided fields. Chose a memorable name, maybe a persona. Now lets move on to the next step.

### Registering Vehicles & Firearms

To register vehicles & firearms to your newly created civilian character execute the commands `/firearm register` and `/vehicle register` and fill in the provided fields. If everything is done successfully then it will return an ID and a serial number/license plate. The plate of your vehicle and serial number of your firearm will be required to edit and delete them in the future. You can view a list of your current vehicles and firearms with the command using the buttons attached to the `/civilian info` command.

{% hint style="info" %}
For a list of commands view <https://roleplaybot.xyz/commands>.
{% endhint %}


# Data Transfer

{% hint style="danger" %}
The data transfer window has now closed.
{% endhint %}

{% hint style="warning" %}
You will only be able to transfer your data until **November 20th 2024**, after that all old data will be permanently deleted.
{% endhint %}

## Transferring Your Old Data

This page will talk you through the steps you need to take to transfer your old server data from **RoleplayBot v2.5.6** to **RoleplayBot v3.0.0**.

## Why do I need to transfer my data?

For RoleplayBot v3.0.0 we have decided to make changes to how data is handled internally using the bot and website. These changes mean that we can no longer use our old schemas and have therefore implemented new schemas to handle and store data. The changes we have made include adding, remove and updating field names, for example we have introduced the ability for you to add a **Blood Type** to your civilian character. With the introduction of a new field old civilian characters, created before **Version 3.0.0** will not have access to this field and eventually it can cause complications and issues. By migrating over to a new data format we can also help combat errors and problems that some users reported when using our old data structure prior to **RoleplayBot v2.0.0.**

To mitigate any potential issues we have decided to request users to transfer their old data, converting it in the new format.

## The Risks & Disadvantages of Data Transfer

This feature also has some disadvantages and risks which we must disclose to you. In the v3.0.0 update we completely reworked how civilian weights, heights and ages are measured and validated, therefore existing civilian weights, heights, date of births and ages may not be compatible with the new additions. To overcome this problem civilian weights, heights and date of births will be generated randomly when you transfer your data to be in compliance with our new regulations.

The data transfer system is still currently in **BETA**, therefore it can be expected to encounter issues when using it. This is of course a risk to your data when transferring as error can occur which can lead to data being deleted or written incorrectly. We do recommend you that you **DO NOT** transfer your data if possible to avoid any problems in the future.

## The Limitations of Data Transfer

This feature also has some limitations when it comes to transferring old data to new. Below is a list of limitations and actions taken when data is transferred.

* **Duplicated Data Prevention** - To prevent duplicated data old data will not be migrated if the new version of that same data already exists. This means that if a new civilian character is created with the name **John Doe** it will prevent the transfer of an old civilian character with the new **John Doe**. This is why we recommend you perform the data transfer immediately, before you create any new  data inside your server.
* **Civilian Weight, Height, Age, Date of Birth and Blood Type Fields** - The weight, height, age and date of birth fields have all been updated in the **v3.0.0** update, leaving the old versions incompatible. Therefore when transferring civilian characters those fields are generated randomly, to comply with new regulations. We already introduced a new field, Blood type, in **v3.0.0**, this field is automatically assigned with **O+**, the most popular blood type.
* **Economy Stores, Inventories and all CAD/MDT Panel related data will not be transferred** - The data from your economy stores, inventories and any/all CAD/MDT panel related data will not be transferred. This is because of updates to our modules that make the data entirely incompatible for transfer. We have tried and tested different work arounds but no method was successful enough for production.

## How To Transfer Your Data

To begin the data transfer process, we first strongly urge you to read over **The Risks & Disadvantages of Data Transfer** section which can be found above.

1. First, login and authorise access to your Discord account through the RoleplayBot website (<https://roleplaybot.xyz/login>)

   <figure><img src="https://3166164597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdRTUkNUPApfD0yd81MsB%2Fuploads%2F7xpLbpin4jdusWWGt7qn%2F45OWQyug7H.png?alt=media&amp;token=002502c6-4f7a-421c-8b17-cef66cac0123" alt=""><figcaption></figcaption></figure>
2. Secondly, head to the [RoleplayBot Dashboard](https://roleplaybot.xyz/dashboard) and find the server you want to manage, then click on the manage button (<https://roleplaybot.xyz/dashboard>)

   <figure><img src="https://3166164597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdRTUkNUPApfD0yd81MsB%2Fuploads%2FZ1Tkqk4MYlDKRNgdXEt0%2F86g66ryPFS.png?alt=media&amp;token=0fda7261-a00b-4b28-b64b-bb3ec5d570d4" alt=""><figcaption></figcaption></figure>
3. Thirdly, press the **Transfer Old Data** button on the Manage Server page

   <figure><img src="https://3166164597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdRTUkNUPApfD0yd81MsB%2Fuploads%2FiMahg1YFTNYhjati8M7c%2FbegfZYeZsT.png?alt=media&amp;token=cd2c9710-f3ab-4389-a51e-65480c291874" alt=""><figcaption></figcaption></figure>
4. Finally, read the transfer disclosure, tick the box to confirm you understand to risks and press the **Confirm Transfer** button. The data transfer process will typically take **10 seconds** so be patient.

   <figure><img src="https://3166164597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdRTUkNUPApfD0yd81MsB%2Fuploads%2Fvh8NIW82YB5Y6kmd1MsQ%2Fa8wLLEkubF.png?alt=media&amp;token=413c1396-b258-41a2-a504-99bb5a6a31a3" alt=""><figcaption></figcaption></figure>

**All Done!** If you get a confirmation message like the one shown below then your data has been transferred successfully, if you are having trouble transferring your data then please [contact support](https://roleplaybot.xyz/support).

<figure><img src="https://3166164597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdRTUkNUPApfD0yd81MsB%2Fuploads%2FckEtPJ5eZE3XTRzbOhCw%2FlmVaFsLB8v.png?alt=media&amp;token=85c7c450-2205-4a63-be93-bd19433f8aae" alt=""><figcaption></figcaption></figure>


# CAD/MDT Information

{% hint style="danger" %}
The CAD/MDT module has been removed as of the v3.0.0 update.
{% endhint %}

{% content-ref url="/pages/TQuhfN2xxqcLlWpuoRJy" %}
[Law Enforcement MDT](/advanced/mdt/leo)
{% endcontent-ref %}

{% content-ref url="/pages/qmHp6OJj4rwUNbTzEPsF" %}
[Fire Department MDT](/advanced/mdt/fd)
{% endcontent-ref %}

{% content-ref url="/pages/dAIcIlzKoofSgWggbLf5" %}
[Dispatcher MDT](/advanced/mdt/dispatch)
{% endcontent-ref %}


# Law Enforcement MDT

{% hint style="danger" %}
The CAD/MDT module has been removed as of the v3.0.0 update.
{% endhint %}

### Starting A Patrol

You must ensure that the guilds CAD/MDT is configurated before continuing (More information [here](/info/config#cad-mdt-configuration))\
\
To start a Law Enforcement patrol session run the command `/patrol start` selecting Law Enforcement under the department field and inputting an identifier (Callsign). Now await for your patrol channel to be created. Inside the channel you will see an option to Login, Press that button and await automatic department authorisation, If you have the required roles and pass authorisation then the Law Enforcement MDT will be displayed.

### Interacting with the MDT

The MDT is a embedded discord message with buttons attaches, Its fairly simple to navigate and interact with thanks to the attaches buttons. On the home (Overview) page there will be four buttons, Status, Assignments, Advanced and logout. Using the buttons will execute an interaction and display a new page, The logout button will safely stop your patrol and delete the current channel.&#x20;

### Status Centre

Using the status button will take you to the status centre, Where you are able to choose from the following, 10-8 Available, 10-7 Unavailable, 10-6 Busy, 10-97 Enroute, 10-23 On scene. To exit the status centre simply press the Overview button to be taken back to the main page.

### Advanced Panel

Using the advanced button will take you to the advanced panel, Where you have the option to activate your Panic button, View notes or Lookup a civilians information. Using the Panic button will open a modal asking for your location, After that is filled in the Panic Button will be activated alerting all on duty units, the Panic Button will then change to Clear Panic. To exit the advanced panel simply press the overview button.

### Notepad

Using the notes button with allow you the create a new note, Clear the current note or head back to the overview panel. Creating a new note will open a model, The maximum characters for a note is 4000 (Discord limitations). After creating a note it will be displayed and registered to your patrol database for ease of access (The note will remain unless cleared). Currently we do not allow the ability to edit saved notes. To exit the notepad simply press the overview button.

### Assignments Panel

Using the assignments button will take you to your current assignments, Unless you have been assigned a call by a dispatcher then this panel will be empty, However if you have been assigned a call then it will display the call information and the option to clear the call. To exit the assignments panel simply press the overview button.

### Looking Up Civilians

To lookup a civilians information first enter the advanced panel through the advanced button, Then select the lookup button and enter the civilians name. If the civilian exists then it will display the general information, Also allowing you to view the civilians vehicles, firearms, history and the option to clear the civilians name. Using the vehicles & firearms button will display the civilians registered vehicles/firearms. You are also able to arrest the current civilian inside this panel. Upon looking up a registered civilian the name is stored inside your patrol database, Meaning that if you need to leave the lookup page you will be able to easily regain progress by pressing the lookup button again. To search up a different civilian use the clear button.


# Fire Department MDT

{% hint style="danger" %}
The CAD/MDT module has been removed as of the v3.0.0 update.
{% endhint %}

### Starting A Patrol

You must ensure that the guilds CAD/MDT is configurated before continuing (More information [here](/info/config#cad-mdt-configuration))\
\
To start a Fire Department patrol session run the command `/patrol start` selecting Fire Department under the department field and inputting an identifier (Callsign). Now await for your patrol channel to be created. Inside the channel you will see an option to Login, Press that button and await automatic department authorisation, If you have the required roles and pass authorisation then the Fire Department MDT will be displayed.

### Interacting with the MDT

The MDT is a embedded discord message with buttons attaches, Its fairly simple to navigate and interact with thanks to the attaches buttons. On the home (Overview) page there will be four buttons, Status, Assignments, Advanced and logout. Using the buttons will execute an interaction and display a new page, The logout button will safely stop your patrol and delete the current channel.&#x20;

### Status Centre

Using the status button will take you to the status centre, Where you are able to choose from the following, 10-8 Available, 10-7 Unavailable, 10-6 Busy, 10-97 Enroute, 10-23 On scene. To exit the status centre simply press the Overview button to be taken back to the main page.

### Advanced Panel

Using the advanced button will take you to the advanced panel, Where you have the option to activate your PASS alarm or Lookup a civilians medical records and information. Using the PASS alarm button will open a modal asking for your location, After that is filled in the PASS alarm will be activated alerting all on duty units, the PASS Button will then change to Clear PASS. To exit the advanced panel simply press the overview button.

### Assignments Panel

Using the assignments button will take you to your current assignments, Unless you have been assigned a call by a dispatcher then this panel will be empty, However if you have been assigned a call then it will display the call information and the option to clear the call. To exit the assignments panel simply press the overview button.

### Looking Up Patients

To lookup a civilians medical records and general information first enter the advanced panel through the advanced button, Then select the lookup button and enter the civilians name. If the civilian exists then it will display the general information, Also allowing you to view the civilians medical records or to clear the civilians name. Upon looking up a registered civilian the name is stored inside your patrol database, Meaning that if you need to leave the lookup page you will be able to easily regain progress by pressing the lookup button again. To search up a different civilian use the clear button.


# Dispatcher MDT

{% hint style="danger" %}
The CAD/MDT module has been removed as of the v3.0.0 update.
{% endhint %}


# FAQ

{% hint style="info" %}
To ask any questions and receive support, join our [Discord support server](https://roleplaybot.xyz/support).
{% endhint %}


# Bug Tracker

We keep a list of all active bugs inside RoleplayBots [support server](https://roleplaybot.xyz/support). You must also use the support server to report any bugs you find, simply open a ticket and tell us your problem.


# API Introduction

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

{% tabs %}
{% tab title="Base URL" %}
`https://roleplaybot.xyz/api`
{% endtab %}
{% endtabs %}

### Introduction

Welcome to RoleplayBot's API Documentation, Inside the documentation you will find all the fundamentals required to communicate with the API and develop your own applications. RoleplayBot API is built around REST, receives data from JSON-Bodies and sends data with JSON-Bodies

### What is an API?

An **A**pplication **P**rogramming **I**nterface (API) is a way of two or more applications or computers to communicate with each other. It is a type of software interface containing a set of endpoints with specific request and functions allowing the creation and access to data. In our case you send requests to the RoleplayBot database and either receive, delete, edit or create data.

### How do I begin?

We recommend that you have a basic knowledge of computing and APIs to better understand this guide, However most guides are simplified and user friendly. More advanced developers can request further support inside our [support server](https://roleplaybot.xyz/support)

### Any questions?

Read through the rest of the documentation before requesting dedicated support, If you still require support after reading through our articles then open an API ticket inside our [support server](https://roleplaybot.xyz/support)&#x20;

{% content-ref url="/pages/G45XJQB8rtr4mVDUEEyH" %}
[Guides](/api/guides)
{% endcontent-ref %}

{% content-ref url="/pages/WjhBdC9Nj5kyCK77yc0e" %}
[API Authorization](/api/guides/authorization)
{% endcontent-ref %}


# Guides

{% content-ref url="/pages/WjhBdC9Nj5kyCK77yc0e" %}
[API Authorization](/api/guides/authorization)
{% endcontent-ref %}

{% content-ref url="/pages/gl7ShIHLZGjemhH4Iqlp" %}
[Getting Started](/api/guides/starting)
{% endcontent-ref %}

{% content-ref url="/pages/R628bbPfQiopu4HmyeYZ" %}
[Civilian Requests](/api/guides/civilian)
{% endcontent-ref %}

{% content-ref url="/pages/hiRPKivpt7u3jZPhIAQd" %}
[Building a Project](/api/guides/projects)
{% endcontent-ref %}


# API Authorization

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

To access RoleplayBot's API you must have an Authorization key, These keys are used to secure the API and keep data safe, Without Authorization keys anyone would be able to access and delete your data. These keys are used in request headers alongside your guild to communicate with the server and request specific data.

### Getting a key

To create an API key you can head over to <https://dashboard.roleplaybot.xyz/guilds>, Select your guilds and generate an API key. Alternatively inside your discord guild use RoleplayBot's integrated command `/api key view,` This will create an API key if one doesn't exist (Restricted to Administrators only). You can also view the API key using the same command.&#x20;

### Requesting deletion of a key

If your API key was generated through the dashboard then head over to <https://dashboard.roleplaybot.xyz/guilds>, Select your guild and delete the API Key. Alternatively If your key has been exposed or you want it changed then directly contact RoleplayBot's API support team through our [support server](https://roleplaybot.xyz/support). Furthermore, You can use the command `/api key delete` to instantly delete your API key inside your discord server.


# Getting Started

To get started with RoleplayBot's API you must meet the prerequisites. This guide is based on accessing the API from a REST client, The API can also be accessed through other means.

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

### Prerequisites

* Access to a REST Client (Recommended For PC, [Insomnia](https://insomnia.rest/download))
* Basic knowledge of computing
* Access to a computer (**HIGHLY RECOMMENDED**)
* Authorization Key
* Your Guild ID

### Requirements

Firstly, We will start by accessing an Authorization key for your server (Need a key? [View here](/api/guides/authorization#getting-a-key)) and getting your guild ID. Authorization keys secure the API and restrict only authorized users from accessing sensitive guild data, Your guild ID is required to access and send data specific to your guild. Need help getting your guild ID? [View here](https://github.com/manix84/discord_gmod_addon_v2/wiki/Finding-your-Guild-ID-%28Server-ID%29).

### Getting started

Now, Lets make a request to the API using the fields we just gathered.

## API Version

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/version`

Returns the current API version

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

{% tabs %}
{% tab title="401: Unauthorized Invalid Authorization Key (Field empty or invalid key)" %}

```javascript
{
	"authentication": false,
	"error": "401 Unauthorised",
	"details": "Invalid Authorization key (20050)"
}
```

{% endtab %}

{% tab title="200: OK Successful Request" %}

```javascript
{
    "version": "v1.1.xx"
}
```

{% endtab %}
{% endtabs %}

### Advancing

To advance further check out our other Guides!


# Civilian Requests

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

### Civilian Information

Now we are going to request an already existing civilians information, For this you will require an already create civilian character inside your guild, Let make the first request with a JSON Body.

## Civilian Information

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/civilian/info`

Returns a civilians information

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                   | Type      | Description              |
| -------------------------------------- | --------- | ------------------------ |
| name<mark style="color:red;">\*</mark> | CIV\_NAME | Civilian Characters Name |

{% tabs %}
{% tab title="200: OK Successful Request" %}

```javascript
{
    "guildID": "GUILD_ID",
    "userID": "USER_ID",
    "userName": "USER_NAME",
    "civilian": [],
    "citations": [],
    "fines": [],
    "arrests": [],
    "hospitalRecords": []
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}
{% endtabs %}

### Deleting, Editing And Creating Civilians

With the API you can form almost anything that you can do with the normal version of RoleplayBot, Leaving it ideal for individual projects and different variations of RoleplayBot. If you have created something with RoleplayBot's API then please get in contact with us, We Would love to reward active developers!

## Delete Civilian

<mark style="color:red;">`DELETE`</mark> `https://roleplaybot.xyz/api/civilian/delete`

Deletes a civilian character

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                   | Type      | Description            |
| -------------------------------------- | --------- | ---------------------- |
| name<mark style="color:red;">\*</mark> | CIV\_NAME | Civilian Name (String) |

{% tabs %}
{% tab title="200: OK Civilian Deleted" %}
Successfully deleted civilian

```javascript
{
    guildID: "GUILD_ID",
    civilianID: "CIV_ID",
    civilianName: "CIV_NAME",
    userName: "USER_NAME",
    userID: "USER_ID",
    success: "Deleted civilian",
    civilian: []
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to delete civilian" %}
Database error, Unable to delete civilian character inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}
```

{% endtab %}
{% endtabs %}

## Edit Civilian

<mark style="color:purple;">`PATCH`</mark> `https://roleplaybot.xyz/api/civilian/edit`

Edits a civilian character with the specified field and value\
Valid Fields:\
\- hair color (Value: String)\
\- name (Value: String)\
\- age (Value: Number <100)\
\- dob (Value: String)\
\- height (Value: Number <500)\
\- weight (Value: Number <500)\
\- occupation (Value: String)\
\- address (Value: String)

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                    | Type      | Description                                    |
| --------------------------------------- | --------- | ---------------------------------------------- |
| name<mark style="color:red;">\*</mark>  | CIV\_NAME | Civilian Name (String)                         |
| field<mark style="color:red;">\*</mark> | FIELD     | Field to edit (Must be listed in valid fields) |
| value<mark style="color:red;">\*</mark> | VALUE     | Value to set (Must match allocated field)      |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="202: Accepted Value doesn't differ" %}
Setting value is the same as the current value

```javascript
{
    error: 'Character <FIELD> is already <VALUE> (<ERR_CODE>)'
}
```

{% endtab %}

{% tab title="201: Created Civilian Edited" %}
Civilian successfully edited

```javascript
{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    userName: "USER_NAME",
    userID: "USER_ID",
    field: "FIELD",
    value: "VALUE",
    oldValue: "OLD_VALUE",
    success: 'Field updated',
    civilian: []
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to edit civilian" %}
Database error, Unable to edit civilian character inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}
```

{% endtab %}
{% endtabs %}

## Create Civilian

<mark style="color:green;">`POST`</mark> `https://roleplaybot.xyz/api/civilian/create`

Creates a civilian character with supplied parameters

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                         | Type            | Description                                    |
| -------------------------------------------- | --------------- | ---------------------------------------------- |
| userID<mark style="color:red;">\*</mark>     | USER\_ID        | Creating Users ID (String)                     |
| userName<mark style="color:red;">\*</mark>   | USER\_NAME      | Creating Users Name (String)                   |
| name<mark style="color:red;">\*</mark>       | CIV\_NAME       | Civilian Name (String) (<100 Characters)       |
| age<mark style="color:red;">\*</mark>        | CIV\_AGE        | Civilian Age (Number) (<100)                   |
| dob<mark style="color:red;">\*</mark>        | CIV\_DOB        | Civilian Date Of Birth (String)                |
| gender<mark style="color:red;">\*</mark>     | CIV\_GENDER     | Civilian Gender (Takes: Male, Female Or Other) |
| hair<mark style="color:red;">\*</mark>       | CIV\_HAIR       | Civilian Hair Color (String)                   |
| weight<mark style="color:red;">\*</mark>     | CIV\_WEIGHT     | Civilian Weight in KG (Number) (<500)          |
| height<mark style="color:red;">\*</mark>     | CIV\_HEIGHT     | Civilian Height in CM (Number) (<500)          |
| address<mark style="color:red;">\*</mark>    | CIV\_ADDRESS    | Civilian Address (String)                      |
| occupation<mark style="color:red;">\*</mark> | CIV\_OCCUPATION | Civilian Occupation (String)                   |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="400: Bad Request Civilian name already exists" %}
A civilian with that specified name already existing inside your guild

```javascript
{
    error: "400 Bad request",
    details: "Civilian character already exists (10020)"
}
```

{% endtab %}

{% tab title="201: Created Created civilian" %}

```javascript
{
    guildID: "GUILD_ID",
    civilianID: "CIV_ID",
    civilianName: "CIV_NAME",
    userName: "USER_NAME",
    userID: "USER_ID",
    success: "Successfully created civilian",
    civilian: []
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to register civilian" %}
Database error, Unable to register civilian character inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10022)"
}
```

{% endtab %}
{% endtabs %}

### Listing Civilians

To list and view the current amount of active civilians registered inside your guild using the following endpoint, The civilians array with provide an object per civilian. Run the request to get a better idea of the structure

## List Civilians

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/civilian/list`

Provides an array with objects per active civilian characters, also returns a value specifying the current amount of civilians

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="200: OK Civilians Found" %}
One or more civilians found and listed

```javascript
{
    amount: "CIV_AMOUNT",
    guildID: "GUILD_ID",
    civilians: []
}
```

{% endtab %}

{% tab title="404: Not Found No Civilians Found" %}
There is no registered civilian characters inside the guild

```javascript
{
    error: "404 Not found",
    details: "Unable to find any civilian characters (20060)"
}
```

{% endtab %}
{% endtabs %}

### Moving On

Now that you have the general idea of GET, POST, PATCH and DELETE requests its time to move on and expand your knowledge, We recommend checking out the endpoints section for a list of API Endpoints and methods.


# Building a Project

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

Building a project with RoleplayBot has never been easier, With the latest version of RoleplayBot's API you can access features throughout a variety of networks. All of the data is stored under a discord guild however this doesn't stop from addon extensions such as FiveM GUIs, Roblox Plugins and other applications! Our API projects are community driven leading to endless possibilities. If you have created a project with RoleplayBot's API then please contact us

### Example Application

{% hint style="info" %}
**Example application coming soon...**
{% endhint %}


# Endpoints

{% content-ref url="/pages/FlqBH8OLfM62gVSbuqj0" %}
[Civilian Endpoints](/api/endpoints/civilian)
{% endcontent-ref %}

{% content-ref url="/pages/FKOvsOkeI2l0MNDt1gSA" %}
[Vehicle Endpoints](/api/endpoints/vehicle)
{% endcontent-ref %}

{% content-ref url="/pages/HM6zBXDr9neJKuXdMobD" %}
[Firearm Endpoints](/api/endpoints/firearm)
{% endcontent-ref %}

{% content-ref url="/pages/tZD2pdhGBFumpbL5bc72" %}
[Medical Endpoint](/api/endpoints/medical)
{% endcontent-ref %}

{% content-ref url="/pages/9d88pS0o3gYw1w8YWm4J" %}
[Law Enforcement Endpoints](/api/endpoints/leo)
{% endcontent-ref %}


# Civilian Endpoints

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

### Civilian Endpoints

Raw list of civilian endpoints:

* GET /civilian/info
* GET /civilian/list
* POST /civilian/create
* PATCH /civilian/edit
* PATCH /civilian/bolo
* PATCH /civilian/deceased
* DELETE /civilian/delete

List of civilian endpoint methods

{% tabs %}
{% tab title="Civilian Array Structure" %}
If you see the empty "civilian" array or `civilian: []`  This is simply just the placeholder for the civilian object structure, Which looks like this in all major requests: (Inside the array)

```javascript
{            
   deceased: "DECEASED",
   bolo: "BOLO",
   boloReason: "REASON",
   civilianAge: "AGE",
   civilianDOB: "DOB",
   civilianGender: "GENDER",
   civilianHairColor: "HAIR COLOR",
   civilianHeight: "HEIGHT",
   civilianWeight: "WEIGHT",
   civilianAddress: "ADDRESS",
   civilianOccupation: "OCCUPATION",
   registrationTimestamp: "TIMESTAMP",
}
```

{% endtab %}
{% endtabs %}

## Civilian Information

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/civilian/info`

Returns a civilians information

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                   | Type      | Description                       |
| -------------------------------------- | --------- | --------------------------------- |
| name<mark style="color:red;">\*</mark> | CIV\_NAME | Civilian Characters Name (String) |

{% tabs %}
{% tab title="200: OK Civilian Found" %}
Citations, Fine, Arrests and Hospital Record arrays provide an object per action.

```javascript
{
    "guildID": "GUILD_ID",
    "userID": "USER_ID",
    "userName": "USER_NAME",
    "civilian": [],
    "citations": [
        {
            "officerName": "OFFICER_NAME",
            "officerID": "OFFICER_ID",
            "amount": "AMOUNT",
            "charges": "CHARGES",
            "timestamp": "TIMESTAMP"
        }
    ],
    "fines": [
        {
            "officerName": "OFFICER_NAME",
            "officerID": "OFFICER_ID",
            "amount": "AMOUNT",
            "charges": "CHARGES",
            "timestamp": "TIMESTAMP"
        }
    ],
    "arrests": [
        {
            "officerName": "OFFICER_NAME",
            "officerID": "OFFICER_ID",
            "time": "TIME",
            "charges": "CHARGES",
            "timestamp": "TIMESTAMP"
        }
    ],
    "hospitalRecords": [
        {
            "medicName": "MEDIC_NAME",
            "medicID": "MEDIC_ID",
            "injures": "INJURES",
            "time": "TIME",
            "timestamp": "TIMESTAMP"
        }
    ]
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="404: Not Found Civilian Not found" %}
Civilian character could not be found

```javascript
{
    error: "404 Not found",
    details: "Character not found (10023)"
}
```

{% endtab %}
{% endtabs %}

## List Civilians

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/civilian/list`

Provides an array with objects per active civilian characters, also returns a value specifying the current amount of civilians

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="200: OK Civilians Found" %}
One or more civilians found and listed

```javascript
{
    amount: "CIV_AMOUNT",
    guildID: "GUILD_ID",
    civilians: []
}
```

{% endtab %}

{% tab title="404: Not Found No Civilians Found" %}
There is no registered civilian characters inside the guild

```javascript
{
    error: "404 Not found",
    details: "Unable to find any civilian characters (20060)"
}
```

{% endtab %}
{% endtabs %}

## Create Civilian

<mark style="color:green;">`POST`</mark> `https://roleplaybot.xyz/api/civilian/create`

Creates a civilian character with supplied parameters

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                         | Type            | Description                                    |
| -------------------------------------------- | --------------- | ---------------------------------------------- |
| userID<mark style="color:red;">\*</mark>     | USER\_ID        | Creating Users ID (String)                     |
| userName<mark style="color:red;">\*</mark>   | USER\_NAME      | Creating Users Name (String)                   |
| name<mark style="color:red;">\*</mark>       | CIV\_NAME       | Civilian Name (String) (<100 Characters)       |
| age<mark style="color:red;">\*</mark>        | CIV\_AGE        | Civilian Age (Number) (<100)                   |
| dob<mark style="color:red;">\*</mark>        | CIV\_DOB        | Civilian Date Of Birth (String)                |
| gender<mark style="color:red;">\*</mark>     | CIV\_GENDER     | Civilian Gender (Takes: Male, Female Or Other) |
| hair<mark style="color:red;">\*</mark>       | CIV\_HAIR       | Civilian Hair Color (String)                   |
| weight<mark style="color:red;">\*</mark>     | CIV\_WEIGHT     | Civilian Weight in KG (Number) (<500)          |
| height<mark style="color:red;">\*</mark>     | CIV\_HEIGHT     | Civilian Height in CM (Number) (<500)          |
| address<mark style="color:red;">\*</mark>    | CIV\_ADDRESS    | Civilian Address (String)                      |
| occupation<mark style="color:red;">\*</mark> | CIV\_OCCUPATION | Civilian Occupation (String)                   |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="400: Bad Request Civilian name already exists" %}
A civilian with that specified name already existing inside your guild

```javascript
{
    error: "400 Bad request",
    details: "Civilian character already exists (10020)"
}
```

{% endtab %}

{% tab title="201: Created Created civilian" %}

```javascript
{
    guildID: "GUILD_ID",
    civilianID: "CIV_ID",
    civilianName: "CIV_NAME",
    userName: "USER_NAME",
    userID: "USER_ID",
    success: "Successfully created civilian",
    civilian: []
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to register civilian" %}
Database error, Unable to register civilian character inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10022)"
}
```

{% endtab %}
{% endtabs %}

## Edit Civilian

<mark style="color:purple;">`PATCH`</mark> `https://roleplaybot.xyz/api/civilian/edit`

Edits a civilian character with the specified field and value\
Valid Fields:\
\- hair color (Value: String)\
\- name (Value: String)\
\- age (Value: Number <100)\
\- dob (Value: String)\
\- height (Value: Number <500)\
\- weight (Value: Number <500)\
\- occupation (Value: String)\
\- address (Value: String)

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                    | Type      | Description                                    |
| --------------------------------------- | --------- | ---------------------------------------------- |
| name<mark style="color:red;">\*</mark>  | CIV\_NAME | Civilian Name (String)                         |
| field<mark style="color:red;">\*</mark> | FIELD     | Field to edit (Must be listed in valid fields) |
| value<mark style="color:red;">\*</mark> | VALUE     | Value to set (Must match allocated field)      |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="202: Accepted Value doesn't differ" %}
Setting value is the same as the current value

```javascript
{
    error: 'Character <FIELD> is already <VALUE> (<ERR_CODE>)'
}
```

{% endtab %}

{% tab title="201: Created Civilian Edited" %}
Civilian successfully edited

```javascript
{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    userName: "USER_NAME",
    userID: "USER_ID",
    field: "FIELD",
    value: "VALUE",
    oldValue: "OLD_VALUE",
    success: 'Field updated',
    civilian: []
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to edit civilian" %}
Database error, Unable to edit civilian character inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}
```

{% endtab %}
{% endtabs %}

## Civilian BOLO

<mark style="color:purple;">`PATCH`</mark> `https://roleplaybot.xyz/api/civilian/bolo`

Call to activate or deactivate a BOLO

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                   | Type      | Description                                     |
| -------------------------------------- | --------- | ----------------------------------------------- |
| name<mark style="color:red;">\*</mark> | CIV\_NAME | Civilian Name (String)                          |
| bolo<mark style="color:red;">\*</mark> | BOLO      | Set BOLO (Boolean) (\*True = Activate BOLO)     |
| reason                                 | REASON    | BOLO Reason (Required when bolo is set to true) |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="404: Not Found Civilian Not Found" %}
Requested civilian character cannot be found

```javascript
{
    error: "404 Not found",
    details: "Character not found (10023)"
}
```

{% endtab %}

{% tab title="202: Accepted BOLO Already Active/inactive" %}
Civilian has an active BOLO

<pre class="language-javascript"><code class="lang-javascript">{
    guildID: "GUILD",
    userName: "USER_NAME",
<strong>    userID: "USER_ID",
</strong>    civilianName: "CIV_NAME",
<strong>    civilianID: "CIV_ID",
</strong>    error: 'BOLO is already (active/incative)',
    civilian: []
}
</code></pre>

{% endtab %}

{% tab title="201: Created BOLO Set Active/inactive" %}
Civilian doesn't have an active BOLO

```javascript
{
    guildID: "GUILD",
    userName: "USER_NAME",
    userID: "USER_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    success: 'BOLO set (active/inactive)',
    civilian: []
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are missing/incorrect" %}
The bolo or reason field is missing or invalid (Incorrect Type)

```javascript
{
    error: "400 Bad request",
    details: "Invalid <FIELD> Provided (<ERR-CODE>)"
}
```

{% endtab %}
{% endtabs %}

## Civilian Deceased

<mark style="color:purple;">`PATCH`</mark> `https://roleplaybot.xyz/api/civilian/deceased`

Sets a civilian deceased.\
WARNING: This action is irreversible, Once a civilian is set deceased it can no longer be used.&#x20;

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                       | Type      | Description                                         |
| ------------------------------------------ | --------- | --------------------------------------------------- |
| name<mark style="color:red;">\*</mark>     | CIV\_NAME | Civilian Name (String)                              |
| deceased<mark style="color:red;">\*</mark> | DECEASED  | Deceased Value (True Boolean) (True = Set Deceased) |

{% tabs %}
{% tab title="202: Accepted Civilian Already Deceased" %}

```javascript
{
    guildID: "GUILD",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    userName: "USER_NAME",
    userID: "USER_ID",
    deceased: "DECEASED",
    error: 'Character is already marked deceased'
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
The deceased field is missing or invalid (Incorrect Type)

```javascript
{
    error: "400 Bad request",
    details: "Invalid <FIELD> Provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="201: Created Civilian Marked Deceased" %}
Civilian has been marked deceased

```javascript
{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    userName: "USER_NAME",
    userID: "USER_ID",
    success: 'Marked deceased',
    civilian: []
}
```

{% endtab %}
{% endtabs %}

## Delete Civilian

<mark style="color:red;">`DELETE`</mark> `https://roleplaybot.xyz/api/civilian/delete`

Deletes a civilian character

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                   | Type      | Description            |
| -------------------------------------- | --------- | ---------------------- |
| name<mark style="color:red;">\*</mark> | CIV\_NAME | Civilian Name (String) |

{% tabs %}
{% tab title="200: OK Civilian Deleted" %}
Successfully deleted civilian

```javascript
{
    guildID: "GUILD_ID",
    civilianID: "CIV_ID",
    civilianName: "CIV_NAME",
    userName: "USER_NAME",
    userID: "USER_ID",
    success: "Deleted civilian",
    civilian: []
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to delete civilian" %}
Database error, Unable to delete civilian character inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}
```

{% endtab %}
{% endtabs %}


# Vehicle Endpoints

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

### Vehicle Endpoints

Raw list of vehicle endpoints:

* GET /vehicle/plate
* GET /vehicle/list
* POST /vehicle/create
* PATCH /vehicle/edit
* DELETE /vehicle/delete

List of vehicle endpoint methods

{% tabs %}
{% tab title="Vehicle Array Structure" %}
If you see the empty "vehicle" array or `vehicle: []`  This is simply just the placeholder for the vehicle object structure, Which looks like this in all major requests: (Inside the array)

```javascript
{            
   id: "ID",
   userID: "USER_ID",
   userName: "USER_NAME",
   civilianID: "CIV_ID",
   civilianName: "CIV_NAME",
   impounded: "IMPOUNDED",
   stolen: "STOLEN",
   plate: "PLATE",
   model: "MODEL",
   registration: "REGISTRATION",
   insurance: "INSURANCE",
   color: "COLOR",
   colorType: "COLOR_TYPE",
   timestamp: "TIMESTAMP",
}
```

{% endtab %}
{% endtabs %}

## Vehicle Search

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/vehicle/plate`

Searches a civilian plate and returns the information

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                    | Type  | Description            |
| --------------------------------------- | ----- | ---------------------- |
| plate<mark style="color:red;">\*</mark> | PLATE | Vehicle Plate (String) |

{% tabs %}
{% tab title="200: OK Vehicle Found" %}
Citations, Fine, Arrests and Hospital Record arrays provide an object per action.

```javascript
{
    found: true,
    guildID: "GUILD_ID",
    vehicle: []
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="404: Not Found Vehicle not found" %}

```javascript
{
    found: false,
    error: "404 Not found",
    details: "Vehicle not found (10023)"
}
```

{% endtab %}
{% endtabs %}

## List Vehicles

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/vehicle/list`

Provides every registered vehicle inside the guild

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="200: OK Vehicles Found" %}
One or more vehicles found and listed

```javascript
{
    amount: "VEHICLE_AMOUNT",
    guildID: "GUILD_ID",
    vehicles: []
}
```

{% endtab %}

{% tab title="404: Not Found No Vehicles Found" %}
There is no registered vehicles inside the guild

```javascript
{
    error: "404 Not found",
    details: "Unable to find any vehicles (20060)"
}
```

{% endtab %}
{% endtabs %}

## Create Vehicle

<mark style="color:green;">`POST`</mark> `https://roleplaybot.xyz/api/vehicle/create`

Registers a vehicle to a civilian character

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                           | Type         | Description                                                              |
| ---------------------------------------------- | ------------ | ------------------------------------------------------------------------ |
| name<mark style="color:red;">\*</mark>         | CIV\_NAME    | Civilian Name (String)                                                   |
| plate<mark style="color:red;">\*</mark>        | PLATE        | Vehicle Plate (String)                                                   |
| model<mark style="color:red;">\*</mark>        | MODEL        | Vehicle Model (String)                                                   |
| color<mark style="color:red;">\*</mark>        | COLOR        | Vehicle Color (String)                                                   |
| colorType<mark style="color:red;">\*</mark>    | COLOR\_TYPE  | Vehicle color type (Takes: Classic, Metallic, Matte, Metal, Pearlescent) |
| registration<mark style="color:red;">\*</mark> | REGISTRATION | Vehicle registration (Takes: Valid, Expired)                             |
| insurance<mark style="color:red;">\*</mark>    | INSURANCE    | Vehicle insurance (Takes: Valid, Expired, None)                          |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="400: Bad Request Vehicle plate already exists" %}
A vehicle with that specified plate already existing inside your guild

```javascript
{
    error: "400 Bad request",
    details: "Registered vehicle plate already exists (10020)"
}
```

{% endtab %}

{% tab title="201: Created Registered Vehicle" %}
Registered vehicle

```javascript
{
    guildID: "GUILD_ID",
    plate: "PLATE",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    success: "Registered vehicle",
    vehicle: []
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to register vehicle" %}
Database error, Unable to register vehicle inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10022)"
}
```

{% endtab %}
{% endtabs %}

## Edit Vehicle

<mark style="color:purple;">`PATCH`</mark> `https://roleplaybot.xyz/api/vehicle/edit`

Edits a vehicle with the specified field and value\
Valid Fields:\
\- color (Value: String)\
\- insurance (Takes: Valid, Expired, None)\
\- registration (Takes: Valid, Expired)\
\- stole (Value: Boolean)

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                    | Type      | Description                                    |
| --------------------------------------- | --------- | ---------------------------------------------- |
| name<mark style="color:red;">\*</mark>  | CIV\_NAME | Civilian Name (String)                         |
| field<mark style="color:red;">\*</mark> | FIELD     | Field to edit (Must be listed in valid fields) |
| value<mark style="color:red;">\*</mark> | VALUE     | Value to set (Must match allocated field)      |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="201: Created Vehicle Edited" %}
Vehicle successfully edited

```javascript
{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    userID: "USER_ID",
    userName: "USER_NAME",
    plate: "PLATE",
    field: "FIELD",
    value: "VALUE",
    oldValue: "OLD_VALUE",
    success: 'Field updated',
    vehicle: []
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to edit vehicle" %}
Database error, Unable to edit vehicle inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}
```

{% endtab %}
{% endtabs %}

## Delete Vehicle

<mark style="color:red;">`DELETE`</mark> `https://roleplaybot.xyz/api/vehicle/delete`

Deletes a vehicle using the vehicle ID

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                        | Type        | Description         |
| ------------------------------------------- | ----------- | ------------------- |
| vehicleID<mark style="color:red;">\*</mark> | VEHICLE\_ID | Vehicle ID (String) |

{% tabs %}
{% tab title="200: OK Vehicle Deleted" %}
Successfully deleted vehicle

```javascript
{
    guildID: "GUILD_ID",
    id: "VEHICLE_ID",
    success: 'Deleted registered vehicle'
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to delete vehicle" %}
Database error, Unable to delete vehicle inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}
```

{% endtab %}
{% endtabs %}


# Firearm Endpoints

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

### Firearm Endpoints

Raw list of firearm endpoints:

* GET /firearm/info
* GET /firearm/list
* POST /firearm/create
* PATCH /firearm/edit
* DELETE /firearm/delete

List of firearm endpoint methods

{% tabs %}
{% tab title="Firearm Array Structure" %}
If you see the empty "firearm" array or `firearm: []`  This is simply just the placeholder for the firearm object structure, Which looks like this in all major requests: (Inside the array)

```javascript
{            
   id: "ID",
   userID: "USER_ID",
   userName: "USER_NAME",
   civilianID: "CIV_ID",
   civilianName: "CIV_NAME",
   stolen: "STOLEN",
   serialNumber: "SERIAL_NUMBER",
   model: "MODEL",
   timestamp: "TIMESTAMP"
}
```

{% endtab %}
{% endtabs %}

## Firearm Information (Search)

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/firearm/info`

Searches for a registered firearm, Returns information if it exists.

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                           | Type           | Description                           |
| ---------------------------------------------- | -------------- | ------------------------------------- |
| serialNumber<mark style="color:red;">\*</mark> | SERIAL\_NUMBER | Firearm Serial Number (String) (# ID) |

{% tabs %}
{% tab title="200: OK Firearm Found" %}
Firearm found and information displayed

```javascript
{
    found: true,
    guildID: "GUILD_ID",
    firearm: []
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="404: Not Found Firearm not found" %}

```javascript
{
    found: false,
    error: "404 Not found",
    details: "Firearm not found (10023)"
}
```

{% endtab %}
{% endtabs %}

## List Firearms

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/firearm/list`

Provides every registered vehicle inside the guild

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="200: OK Firearms Found" %}
One or more firearms found and listed

```javascript
{
    amount: "FIREARM_AMOUNT",
    guildID: "GUILD_ID",
    firearms: []
}
```

{% endtab %}

{% tab title="404: Not Found No Firearms Found" %}
There is no registered firearms inside the guild

```javascript
{
    error: "404 Not found",
    details: "Unable to find any firearms (20060)"
}
```

{% endtab %}
{% endtabs %}

## Create Firearm

<mark style="color:green;">`POST`</mark> `https://roleplaybot.xyz/api/firearm/create`

Registers a firearm to a civilian character

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                    | Type      | Description            |
| --------------------------------------- | --------- | ---------------------- |
| name<mark style="color:red;">\*</mark>  | CIV\_NAME | Civilian Name (String) |
| model<mark style="color:red;">\*</mark> | MODEL     | Firearm Model (String) |
| color<mark style="color:red;">\*</mark> | COLOR     | Firearm Color (String) |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="201: Created Registered Firearm" %}
Registered vehicle

```javascript
{
    guildID: "GUILD_ID",
    civilianID: "CIV_ID",
    civilianName: "CIV_NAME",
    userName: "USER_NAME",
    userID: "USER_ID"
    success: "Registered firearm",
    firearm: []
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to register firearm" %}
Database error, Unable to register firearm inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10022)"
}
```

{% endtab %}
{% endtabs %}

## Edit Firearm

<mark style="color:purple;">`PATCH`</mark> `https://roleplaybot.xyz/api/firearm/edit`

Edits a firearm with the specified field and value\
Valid Fields:\
\- color (Value: String)\
\- stole (Value: Boolean)

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                    | Type      | Description                                    |
| --------------------------------------- | --------- | ---------------------------------------------- |
| name<mark style="color:red;">\*</mark>  | CIV\_NAME | Civilian Name (String)                         |
| field<mark style="color:red;">\*</mark> | FIELD     | Field to edit (Must be listed in valid fields) |
| value<mark style="color:red;">\*</mark> | VALUE     | Value to set (Must match allocated field)      |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="201: Created Firearm Edited" %}
Firearm successfully edited

```javascript
{
    guildID: "GUILD_ID",
    serialNumber: "SERIAL_NUMBER",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    userID: "USER_ID",
    userName: "USER_NAME",
    plate: "PLATE",
    success: "Updated firearm to <...>",
    firearm: []
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to edit firearm" %}
Database error, Unable to edit firearm inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}
```

{% endtab %}
{% endtabs %}

## Delete Vehicle

<mark style="color:red;">`DELETE`</mark> `https://roleplaybot.xyz/api/firearm/delete`

Deletes a firearm using the serial number

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                           | Type           | Description                           |
| ---------------------------------------------- | -------------- | ------------------------------------- |
| serialNumber<mark style="color:red;">\*</mark> | SERIAL\_NUMBER | Firearm Serial Number (String) (# ID) |

{% tabs %}
{% tab title="200: OK Firearm Deleted" %}
Successfully deleted firearm

```javascript
{
    guildID: "GUILD_ID",
    id: "VEHICLE_ID",
    success: 'Deleted registered firearm'
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to delete firearm" %}
Database error, Unable to delete firearm inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}
```

{% endtab %}
{% endtabs %}


# Medical Endpoint

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

### Medical Endpoints

Raw list of medical endpoints:

* GET /medical/records
* POST /medical/admit

List of medical endpoint methods

## Medical Records (Search)

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/medical/records`

Searches a civilians medical records

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                   | Type      | Description            |
| -------------------------------------- | --------- | ---------------------- |
| name<mark style="color:red;">\*</mark> | CIV\_NAME | Civilian Name (String) |

{% tabs %}
{% tab title="200: OK Admissions Found" %}
Found one or more hospital admissions (Displays one or more objects inside the admissions array and empty if none are found)

<pre class="language-javascript"><code class="lang-javascript">{
<strong>    guildID: "GUILD_ID",
</strong><strong>    civilianName: "CIV_NAME",
</strong>    civilianID: "CIV_ID",
    amount: "AMOUNT",
    admissions: [
        {
            count: "COUNT",
            unitsName: "UNIT_NAME",
            unitsID: "UNIT_ID",
            time: "RECOVERY_TIME",
            injures: "INJURES",
            timestamp: "TIMESTAMP"
        }
    ]
}
</code></pre>

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="404: Not Found Civilian not found" %}

```javascript
{
    error: "404 Not found",
    details: "Character not found (10023)"
}
```

{% endtab %}
{% endtabs %}

## Medical Admit

<mark style="color:green;">`POST`</mark> `https://roleplaybot.xyz/api/medical/admit`

Admits a user to hospital and creates record

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                       | Type       | Description                              |
| ------------------------------------------ | ---------- | ---------------------------------------- |
| name<mark style="color:red;">\*</mark>     | CIV\_NAME  | Civilian Name (String)                   |
| time<mark style="color:red;">\*</mark>     | TIME       | Recovery time (String) (>5000) (Seconds) |
| injures<mark style="color:red;">\*</mark>  | INJURES    | List of injures (String)                 |
| unitName<mark style="color:red;">\*</mark> | UNIT\_NAME | Admitting units name (String)            |
| unitID<mark style="color:red;">\*</mark>   | UNIT\_ID   | Admitting units ID (String)              |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="201: Created Admitted civilian" %}
Registered vehicle

```javascript
{
    guildID: "GUILD_ID",
    civilianID: "CIV_ID",
    civilianName: "CIV_NAME",
    success: "Admitted civilian",
    admission: [
        {
            unitsName: "UNIT_NAME",
            unitsID: "UNIT_ID",
            time: "<TIME> Seconds",
            injures: "INJURES",
            timestamp: "TIMESTAMP"
         }
     ]
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to admit civilian" %}
Database error, Unable to register admission inside database. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10022)"
}
```

{% endtab %}
{% endtabs %}


# Law Enforcement Endpoints

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

### Law Enforcement Endpoints

Raw list of LEO endpoints:

* GET /leo/records
* GET /leo/impound
* POST /leo/arrest
* POST /leo/cite
* POST /leo/fine
* PATCH /leo/impound

List of Law enforcement endpoint methods

## Civilian Records

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/leo/records`

Searches a civilians arrests, citations and fines

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                   | Type      | Description            |
| -------------------------------------- | --------- | ---------------------- |
| name<mark style="color:red;">\*</mark> | CIV\_NAME | Civilian Name (String) |

{% tabs %}
{% tab title="200: OK Civilian Found" %}
Civilian found and records listed

<pre class="language-javascript"><code class="lang-javascript">{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    citationAmount: "CITE_AMOUNT",
    fineAmount: "FINE_AMOUNT",
    arrestAmount: "ARREST_AMOUNT",
    citations: [
        {
            count: "COUNT",
            officersName: "OFFICER_NAME",
            officersID: "OFFICER_ID",
            amount: "AMOUNT",
            charges: "CHARGES",
            timestamp: "TIMESTAMP"
        }
    ],
    fines: [
        {
            count: "COUNT",
            officersName: "OFFICER_NAME",
            officersID: "OFFICER_ID",
            amount: "AMOUNT",
            charges: "CHARGES",
            timestamp: "TIMESTAMP"
        }
    ],
    arrests: [
        {
            count: "COUNT",
            officersName: "OFFICER_NAME",
            officersID: "OFFICER_ID",
            time: "JAIL_TIME",
            charges: "CHARGES",
            timestamp: "TIMESTAMP"
        }
<strong>    ]
</strong>}
</code></pre>

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="404: Not Found Civilian not found" %}

```javascript
{
    error: "404 Not found",
    details: "Character not found (10023)"
}
```

{% endtab %}
{% endtabs %}

## Check Impound

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/leo/impound`

Checks if a vehicle is impounded

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name  | Type  | Description            |
| ----- | ----- | ---------------------- |
| plate | PLATE | Vehicle Plate (String) |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="200: OK Vehicle Found" %}
Vehicle found and impounded value displayed

```javascript
{
    guildID: "GUILD_ID",
    plate: "PLATE",
    id: "ID",
    impounded: "IMPOUNDED",
    impoundedFee: "IMPOUND_FEE"
}
```

{% endtab %}

{% tab title="404: Not Found Vehicle not found" %}
Requested vehicle was not found

```javascript
{
    error: "404 Not found",
    details: "Vehicle not found (10023)"
}
```

{% endtab %}
{% endtabs %}

## Arrest Civilian

<mark style="color:green;">`POST`</mark> `https://roleplaybot.xyz/api/leo/arrest`

Forms an arrest report on a civilian

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                          | Type          | Description                              |
| --------------------------------------------- | ------------- | ---------------------------------------- |
| name<mark style="color:red;">\*</mark>        | CIV\_NAME     | Civilian Name (String)                   |
| officerName<mark style="color:red;">\*</mark> | OFFICER\_NAME | Arresting Officers Discord Name (String) |
| officerID<mark style="color:red;">\*</mark>   | OFFICER\_ID   | Arresting Officers Discord ID (String)   |
| charges<mark style="color:red;">\*</mark>     | CHARGES       | Arrest Charges (String)                  |
| time<mark style="color:red;">\*</mark>        | TIME          | Jail Time (Number) (>5000)               |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="201: Created Arrested Civilian" %}
Successfully arrested civilian

```javascript
{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    success: `Arrested civilian`,
    arrest: [
        {
            officersName: "OFFICER_NAME",
            officersID: "OFFICER_ID",
            time: "<TIME> Seconds",
            charges: "CHARGES",
            timestamp: "TIMESTAMP"
        }
    ]
}
```

{% endtab %}

{% tab title="404: Not Found Civilian Not Found" %}
Requested civilian could not be found

```javascript
{
    error: "404 Not found",
    details: "Character not found (10023)"
}
```

{% endtab %}
{% endtabs %}

## Cite Civilian

<mark style="color:green;">`POST`</mark> `https://roleplaybot.xyz/api/leo/cite`

Creates a citation and issues it to a civilian

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                          | Type          | Description                           |
| --------------------------------------------- | ------------- | ------------------------------------- |
| name<mark style="color:red;">\*</mark>        | CIV\_NAME     | Civilian Name (String)                |
| officerName<mark style="color:red;">\*</mark> | OFFICER\_NAME | Citing Officers Discord Name (String) |
| officerID<mark style="color:red;">\*</mark>   | OFFICER\_ID   | Citing Officers Discord ID (String)   |
| charges<mark style="color:red;">\*</mark>     | CHARGES       | Citation Charges (String)             |
| amount<mark style="color:red;">\*</mark>      | AMOUNT        | Cite Amount (Number) (>5000)          |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="201: Created Cited Civilian" %}
Successfully cited civilian

```javascript
{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    success: "Cited civilian",
    citation: [
        {
            officersName: "OFFICER_NAME",
            officersID: "OFFICER_ID",
            amount: "$<AMOUNT>",
            charges: "CHARGES",
            timestamp: "TIMESTAMP"
        }
    ]
}
```

{% endtab %}

{% tab title="404: Not Found Civilian Not Found" %}
Requested civilian could not be found

```javascript
{
    error: "404 Not found",
    details: "Character not found (10023)"
}
```

{% endtab %}
{% endtabs %}

## Fine Civilian

<mark style="color:green;">`POST`</mark> `https://roleplaybot.xyz/api/leo/fine`

Fines a civilian

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                          | Type          | Description                           |
| --------------------------------------------- | ------------- | ------------------------------------- |
| name<mark style="color:red;">\*</mark>        | CIV\_NAME     | Civilian Name (String)                |
| officerName<mark style="color:red;">\*</mark> | OFFICER\_NAME | Fining Officers Discord Name (String) |
| officerID<mark style="color:red;">\*</mark>   | OFFICER\_ID   | Fining Officers Discord ID (String)   |
| charges<mark style="color:red;">\*</mark>     | CHARGES       | Fine Charges (String)                 |
| amount<mark style="color:red;">\*</mark>      | AMOUNT        | Fine Amount (Number) (>5000)          |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="201: Created Fined Civilian" %}
Successfully fined civilian

```javascript
{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    success: "Fined civilian",
    fine: [
        {
            officersName: "OFFICER_NAME",
            officersID: "OFFICER_ID",
            amount: "$<AMOUNT>",
            charges: "CHARGES",
            timestamp: "TIMESTAMP"
        }
    ]
}
```

{% endtab %}

{% tab title="404: Not Found Civilian Not Found" %}
Requested civilian could not be found

```javascript
{
    error: "404 Not found",
    details: "Character not found (10023)"
}
```

{% endtab %}
{% endtabs %}

## Impound Vehicle

<mark style="color:purple;">`PATCH`</mark> `https://roleplaybot.xyz/api/leo/impound`

Impound or lift the impound of a registered vehicle

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                      | Type    | Description                                                   |
| ----------------------------------------- | ------- | ------------------------------------------------------------- |
| plate<mark style="color:red;">\*</mark>   | PLATE   | Vehicle Plate (String)                                        |
| impound<mark style="color:red;">\*</mark> | IMPOUND | Impound Stated Vehicle (Boolean)                              |
| fee                                       | FEE     | Impound Fee (Number) (>5000) (Only if impound statement true) |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

```javascript
{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}
```

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}

```javascript
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}
```

{% endtab %}

{% tab title="202: Accepted Impounded Vehicle" %}
Impounded Vehicle

```javascript
{
    guildID: "GUILD_ID",
    plate: "PLATE",
    userID: "USER_ID",
    userName: "USER_NAME",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    impounded: true,
    error: "Vehicle impounded",
    vehicle: [
        {
            impoundedFee: "FEE",
            stolen: "STOLEN",
            model: "MODEL",
            registration: "REGISTRATION",
            insurance: "INSURANCE",
            color: "COLOR",
            colorType: "COLOR_TYPE",
            timestamp: "TIMESTAMP",
        }
    ]
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to process request" %}
Database error, Unable to edit impound. Contact RoleplayBot support

```javascript
{
    error: "500 Internal server error",
    details: "Unable to execute request (10022)"
}
```

{% endtab %}

{% tab title="202: Accepted Removed Impounded Vehicle" %}

```javascript
{
    guildID: "GUILD_ID",
    plate: "PLATE",
    userID: "USER_ID",
    userName: "USER_NAME",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    impounded: false,
    error: "Vehicle removed from impounded",
    vehicle: [
        {
            impoundedFee: null,
            stolen: "STOLEN",
            model: "MODEL",
            registration: "REGISTRATION",
            insurance: "INSURANCE",
            color: "COLOR",
            colorType: "COLOR_TYPE",
            timestamp: "TIMESTAMP",
        }
    ]
}
```

{% endtab %}

{% tab title="404: Not Found Vehicle Not found" %}

```javascript
{
    error: "404 Not found",
    details: "Vehicle not found (10023)"
}
```

{% endtab %}
{% endtabs %}


# Errors

{% content-ref url="/pages/cR9e62SRSWgmF04gBF8p" %}
[Error Codes](/api/errors/codes)
{% endcontent-ref %}

{% content-ref url="/pages/Qw9Um9lpIkbIKWWJEnow" %}
[Rate limited](/api/errors/rate-limited)
{% endcontent-ref %}


# Error Codes

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

An error code is provided apart of a known unsuccessful request, The list below is provided for troubleshooting API Errors individually. We encourage you to contact the support team if your unable to resolve your error here.

### 100xx Errors

These are **server side** errors, Meaning that the server has processed the request however reached an error whilst formatting, presenting or registering inside the database. These errors usually occur if the server is overloaded or in a idle state. We encourage you to report any of these errors directly to the support team if your unable to resolve them.

10020 - Content already exists\
10021 - Server was unable to set existing resource\
10022 - Server was unable to register new resource \
10023 - Requested resource not found (404)\
10024 - Server was unable to delete existing resource\
10025 - Content not update\
10026 - Server was unable to update existing resource

### 200xx Errors

These are **client side** error, Meaning that the client (You) have requested incorrectly or in a forbidden method. These errors usually occur if you have formed a request incorrectly or the server throws an unhandled client error.\
\
20050 - Invalid Authorization key provided (Empty or Not Registered)\
20051 - Header not provided or empty\
20052 - JSON Field invalid (Not provided, Empty or invalid type)\
20056 - Field exceeds set limit (Usually in characters or displayed limit)\
20058 - Client requested a forbidden guild (Not affiliated with authorization key)\
20060 - Resource Not found (None exist inside guild)\
40070 - Global Rate Limit Exceeded


# Rate limited

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

The rate limit system is implemented to prevent abuse and spam requests reaching our endpoints, For example malicious software can be used to constantly request an endpoint and overload the server, Stopping other from using it. This is the reason why we have introduced a rate limit system, Below you can view the global rate limit and specific endpoints rate limit (Any endpoint not specified follows the global rate limit).

### Headers

| Header Name           | Description                                                  |
| --------------------- | ------------------------------------------------------------ |
| X-RateLimit-Limit     | The amount of requests you can make                          |
| X-RateLimit-Remaining | The amount of remaining requests you can make                |
| X-RateLimit-Reset     | Epoch (Millisecond) timestamp at which the rate limit resets |

### Global Rate Limit

The global rate limit is set at **20 requests per second**, This is reasonable for any minor actions or projects that don't require many requests to be called simultaneously.

### Exact Rate Limit

Exact rate limit affects any direct endpoint route, For example `/civilian` and `/firearm` have routed endpoints making them apart of the exact rate limit. The exact rate limit is currently set to **10 requests per second as** these endpoints complete direct requests to the database.

{% hint style="warning" %}
**If your project is constantly getting rate limited due to the amount of requests then please get in contact with** [**RoleplayBot Support**](https://roleplaybot.xyz/support)**, We may be able to increase your rate limit.**
{% endhint %}


