Skip to main content

Overview

The Citizens API provides endpoints for creating and managing citizens, their vehicles, weapons, medical records, and licenses.
All citizen endpoints require authentication. Some endpoints may be restricted based on CAD features and user permissions.

Get Citizens

curl -X GET "https://your-cad.com/api/citizen?query=John&skip=0" \
  -H "Cookie: snaily-cad-access-token=<token>"
Get all citizens belonging to the authenticated user.

Query Parameters

query
string
Search by name, surname, SSN, or phone number
skip
number
default:"0"
Number of records to skip for pagination

Response

citizens
array
Array of citizen objects
totalCount
number
Total number of citizens matching the query

Get Citizen by ID

curl -X GET https://your-cad.com/api/citizen/{citizenId} \
  -H "Cookie: snaily-cad-access-token=<token>"
Get detailed information about a specific citizen.

Path Parameters

id
string
required
Citizen ID

Response

id
string
Citizen ID
name
string
First name
surname
string
Last name
socialSecurityNumber
string
Social security number
dateOfBirth
string
Date of birth (ISO 8601)
gender
object
Gender value object
ethnicity
object
Ethnicity value object
driversLicense
object
Driver’s license status
weaponLicense
object
Weapon license status
vehicles
array
Citizen’s registered vehicles (first 12)
weapons
array
Citizen’s registered weapons (first 12)
medicalRecords
array
Medical records

Create Citizen

curl -X POST https://your-cad.com/api/citizen \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John",
    "surname": "Doe",
    "dateOfBirth": "1990-01-15",
    "gender": "male-gender-id",
    "ethnicity": "ethnicity-id",
    "weight": "180",
    "height": "72",
    "hairColor": "brown",
    "eyeColor": "blue",
    "address": "123 Main St",
    "phoneNumber": "555-0123"
  }'
Create a new citizen.

Request Body

name
string
required
First name
surname
string
required
Last name
dateOfBirth
string
required
Date of birth (ISO 8601 format)
gender
string
required
Gender value ID
ethnicity
string
required
Ethnicity value ID
weight
string
Weight
height
string
Height
hairColor
string
Hair color
eyeColor
string
Eye color
address
string
Residential address
phoneNumber
string
Phone number
socialSecurityNumber
string
Social security number (auto-generated if not provided)

Response

Returns the created citizen object with all fields.

Error Responses

  • 400 - Invalid data, blacklisted name, or duplicate name (if not allowed)
  • 400 - Maximum citizens per user reached

Update Citizen

curl -X PUT https://your-cad.com/api/citizen/{citizenId} \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John",
    "surname": "Smith",
    "address": "456 Oak Ave"
  }'
Update an existing citizen’s information.

Path Parameters

id
string
required
Citizen ID

Request Body

All fields are optional. Only provided fields will be updated.
name
string
First name
surname
string
Last name
dateOfBirth
string
Date of birth
address
string
Residential address
phoneNumber
string
Phone number

Delete Citizen

curl -X DELETE https://your-cad.com/api/citizen/{citizenId} \
  -H "Cookie: snaily-cad-access-token=<token>"
Delete a citizen permanently.

Path Parameters

id
string
required
Citizen ID

Response

Returns true on success.

Error Responses

  • 403 - Only admins can delete citizens (if feature is disabled)
  • 404 - Citizen not found

Mark Citizen as Deceased

curl -X POST https://your-cad.com/api/citizen/{citizenId}/deceased \
  -H "Cookie: snaily-cad-access-token=<token>"
Mark a citizen as deceased.

Path Parameters

id
string
required
Citizen ID

Response

Returns true on success and triggers a Discord webhook if configured.

Upload Citizen Image

curl -X POST https://your-cad.com/api/citizen/{citizenId} \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -F "image=@/path/to/image.jpg"
Upload an image for a citizen.

Path Parameters

id
string
required
Citizen ID

Request Body

image
file
required
Image file (JPEG, PNG, WebP)

Response

imageId
string
ID of the uploaded image

Get Citizen Records

curl -X GET https://your-cad.com/api/citizen/{citizenId}/records \
  -H "Cookie: snaily-cad-access-token=<token>"
Get all criminal/traffic records for a citizen.

Path Parameters

id
string
required
Citizen ID

Response

Returns an array of record objects including:
  • Arrest reports
  • Traffic citations
  • Written warnings
  • Associated violations and penalties

Vehicles

Register Vehicle

curl -X POST https://your-cad.com/api/vehicles \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "citizenId": "citizen-id",
    "plate": "ABC123",
    "model": "vehicle-model-id",
    "color": "red",
    "registrationStatus": "registration-status-id"
  }'

Request Body

citizenId
string
required
Citizen ID who owns the vehicle
plate
string
required
License plate number
model
string
required
Vehicle model ID
color
string
required
Vehicle color
registrationStatus
string
required
Registration status ID
insuranceStatus
string
Insurance status ID
vinNumber
string
VIN number

Weapons

Register Weapon

curl -X POST https://your-cad.com/api/weapons \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "citizenId": "citizen-id",
    "model": "weapon-model-id",
    "registrationStatus": "registration-status-id",
    "serialNumber": "SN123456"
  }'

Request Body

citizenId
string
required
Citizen ID who owns the weapon
model
string
required
Weapon model ID
registrationStatus
string
required
Registration status ID
serialNumber
string
Weapon serial number

Build docs developers (and LLMs) love