Skip to main content

Overview

The EMS/Fire Department API provides endpoints for managing EMS-FD deputies, medical records, doctor visits, and declaring citizens deceased.
Most EMS-FD endpoints require the EmsFd permission and an active deputy on duty.

Get Deputies

curl -X GET "https://your-cad.com/api/ems-fd?query=" \
  -H "Cookie: snaily-cad-access-token=<token>"
Get all EMS-FD deputies for the authenticated user.

Query Parameters

query
string
Search query for filtering deputies

Response

deputies
array
Array of deputy objects with qualifications and unit properties

Get Active Deputy

curl -X GET https://your-cad.com/api/ems-fd/active-deputy \
  -H "Cookie: snaily-cad-access-token=<token>"
Get the currently active deputy for the authenticated user.

Response

Returns the active deputy object with status, department, division, and citizen information.

Get Active Deputies

curl -X GET "https://your-cad.com/api/ems-fd/active-deputies?skip=0&includeAll=false" \
  -H "Cookie: snaily-cad-access-token=<token>"
Get all currently active EMS-FD deputies and combined units.

Query Parameters

includeAll
boolean
default:"false"
Include all deputies (ignore pagination)
skip
number
default:"0"
Number of records to skip
query
string
Search query

Response

Returns an array of active deputy and combined EMS-FD unit objects.

Create Deputy

curl -X POST https://your-cad.com/api/ems-fd \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "citizenId": "citizen-id",
    "department": "department-id",
    "division": "division-id",
    "callsign": "E-101",
    "badgeNumber": "54321"
  }'
Create a new EMS-FD deputy.

Request Body

citizenId
string
required
Citizen ID to link to deputy
department
string
required
Department ID
division
string
Division ID
callsign
string
required
Deputy callsign (e.g., “E-101”)
badgeNumber
string
required
Badge number
rank
string
Rank ID

Update Deputy

curl -X PUT https://your-cad.com/api/ems-fd/{deputyId} \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "callsign": "E-102",
    "badgeNumber": "54322"
  }'
Update an existing deputy’s information.

Path Parameters

id
string
required
Deputy ID

Delete Deputy

curl -X DELETE https://your-cad.com/api/ems-fd/{deputyId} \
  -H "Cookie: snaily-cad-access-token=<token>"
Delete a deputy.

Path Parameters

id
string
required
Deputy ID

Toggle Panic Button

curl -X POST https://your-cad.com/api/ems-fd/panic-button \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "deputyId": "deputy-id",
    "isEnabled": true
  }'
Enable or disable panic button for a deputy.

Request Body

deputyId
string
required
Deputy ID
isEnabled
boolean
required
Enable or disable panic mode

Medical Records

Create Medical Record

curl -X POST https://your-cad.com/api/ems-fd/medical-records \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "citizenId": "citizen-id",
    "type": "MEDICATION",
    "description": "Prescribed antibiotics",
    "bloodGroup": "blood-group-id"
  }'
Create a medical record for a citizen.

Request Body

citizenId
string
required
Citizen ID
type
string
required
Record type: MEDICATION, ALLERGY, CONDITION, etc.
description
string
required
Medical record description
bloodGroup
string
Blood group value ID

Update Medical Record

curl -X PUT https://your-cad.com/api/ems-fd/medical-records/{recordId} \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "MEDICATION",
    "description": "Updated medication details"
  }'
Update an existing medical record.

Path Parameters

id
string
required
Medical record ID

Delete Medical Record

curl -X DELETE https://your-cad.com/api/ems-fd/medical-records/{recordId} \
  -H "Cookie: snaily-cad-access-token=<token>"
Delete a medical record.

Doctor Visits

Create Doctor Visit

curl -X POST https://your-cad.com/api/ems-fd/doctor-visit \
  -H "Cookie: snaily-cad-access-token=<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "citizenId": "citizen-id",
    "diagnosis": "Common cold",
    "medications": "Rest and fluids",
    "conditions": "Mild fever",
    "description": "Patient presented with cold symptoms"
  }'
Create a doctor visit record.

Request Body

citizenId
string
required
Citizen ID
diagnosis
string
required
Medical diagnosis
medications
string
Prescribed medications
conditions
string
Medical conditions observed
description
string
Additional notes

Declare Citizen Dead/Alive

curl -X POST https://your-cad.com/api/ems-fd/declare/{citizenId} \
  -H "Cookie: snaily-cad-access-token=<token>"
Declare a citizen as deceased or alive (toggle).

Path Parameters

citizenId
string
required
Citizen ID

Response

Returns the updated citizen object with dead status and dateOfDead timestamp.
If the CITIZEN_DELETE_ON_DEAD feature is enabled, the citizen will be permanently deleted instead of marked as deceased.

Get Dead Citizens

curl -X GET https://your-cad.com/api/ems-fd/dead-citizens \
  -H "Cookie: snaily-cad-access-token=<token>"
Get all citizens marked as deceased.

Response

totalCount
number
Total number of dead citizens
citizens
array
Array of deceased citizen objects

Upload Deputy Image

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

Path Parameters

id
string
required
Deputy ID

Request Body

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

Get Deputy Logs

curl -X GET "https://your-cad.com/api/ems-fd/logs?skip=0&includeAll=false" \
  -H "Cookie: snaily-cad-access-token=<token>"
Get time logs for deputies.

Query Parameters

skip
number
default:"0"
Pagination offset
includeAll
boolean
default:"false"
Include all logs
emsFdDeputyId
string
Filter by specific deputy ID
currentUserOnly
boolean
Only show current user’s logs

Response

totalCount
number
Total log entries
logs
array
Array of log objects with start/end times

Build docs developers (and LLMs) love