# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roleplaybot.xyz/api/endpoints/leo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
