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

# Violation

## Create Violation Endpoint

`POST /spsr-api/v1/violations/public`

## Authentication

* **Type:** Bearer Token (JWT) – Operator Token
* **Example:**\
  `Authorization: Bearer xxxxxx`

***

## Request Format

### Headers

| Name          | Value               |
| ------------- | ------------------- |
| Authorization | Bearer `xxxxx`      |
| Content-Type  | multipart/form-data |

***

### Form Data

| Field                      | Type          | Description                              |
| -------------------------- | ------------- | ---------------------------------------- |
| `date`                     | `string`      | timestamp                                |
| `latitude`                 | `double`      | Latitude of violation                    |
| `longitude`                | `double`      | Longitude of violation                   |
| `location`                 | `string`      | Violation location text                  |
| `plateNumber`              | `string`      | Vehicle plate number                     |
| `plateType`                | `string` enum | Type of vehicle plate                    |
| `zoneId`                   | `string`      | Zone UUID                                |
| `imagesDescription`        | `string`      | Description of violation images          |
| `violationType`            | `string` enum | Type of violation                        |
| `isSaudi`                  | `boolean`     | Whether the plate is Saudi               |
| `metadata`                 | `json`        | Optional metadata field                  |
| `fullName`                 | `string`      | Reporter full name                       |
| `identityNumber`           | `string`      | Reporter identity number                 |
| `mobileNumber`             | `string`      | Reporter mobile number                   |
| `supervisorFullName`       | `string`      | Reporter full name                       |
| `supervisorIdentityNumber` | `string`      | Reporter identity number                 |
| `supervisorMobileNumber`   | `string`      | Reporter mobile number                   |
| `images`                   | `file[]`      | One or more image files (max 10MB total) |

***

### Sample `curl` Request

```bash theme={null}
curl --location '{baseUrl}/spsr-api/v1/violations/public' \
--header 'Authorization: Bearer xxxxxx' \
--form 'date=2025-04-08T12:00:00Z' \
--form 'latitude=24.774265' \
--form 'longitude=46.738586' \
--form 'location=Riyadh' \
--form 'plateNumber=2482KXR' \
--form 'plateType=PRIVATE' \
--form 'zoneId=8204c677-34b8-4e53-9ac5-97d6c6f000cf' \
--form 'imagesDescription=no ticket violation' \
--form 'violationType=NO_TICKET' \
--form 'isSaudi=true' \
--form 'metadata="{ \"id\" : \"123456\" }"' \
--form 'fullName=test test' \
--form 'identityNumber=1234567890' \
--form 'mobileNumber=0555555555' \
--form 'supervisorFullName=test test' \
--form 'supervisorIdentityNumber=1234567890' \
--form 'supervisorMobileNumber=0555555555' \
--form 'images=@"/path/to/image.jpg"' 
```

***

## Enum Values

### `plateType`

* PRIVATE
* PUBLIC\_TRANSPORTATION
* PRIVATE\_TRANSPORTATION
* PUBLIC\_MINIBUS
* PRIVATE\_MINIBUS
* TAXI
* Heavy\_Equipment
* EXPORT
* DIPLOMATIC
* MOTORCYCLE

### `violationType`

* NO\_TICKET
* TICKET\_ENDED
* USER\_EXCEED\_PARKING\_TIME
* WRONG\_PARKING
* RESERVED\_PARKING
* OBS\_CLS\_PARKING
* EMRG\_PARKING
* ENT\_EXT\_PARKING
* PROH\_PARKING

***

## Success Response

```json theme={null}
{
  "code": 200,
  "message": "OK",
  "data": {
    "violation_reference_id": "V-20250409-ae732f",
    "status": "PENDING",
    "metadata": {
      "id": "12345"
    }
  }
}
```

***

## Error Responses

| HTTP Code | Message                    | Description                                               |
| --------- | -------------------------- | --------------------------------------------------------- |
| 400       | `Zone not found`           | The provided `zone_id` is invalid or does not exist       |
| 400       | `Image size exceeds limit` | Uploaded image(s) exceed the 10MB file size limit         |
| 400       | `Missing required field`   | A required field in the `violation` object is missing     |
| 400       | `Invalid enum value`       | Wrong value provided for `plate_type` or `violation_type` |
| 401       | `Unauthorized`             | Bearer token is missing or expired                        |
| 403       | `Access denied`            | The user does not have permission to use this endpoint    |
| 500       | `Internal Server Error`    | A server-side error occurred                              |
