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
Search query for filtering deputies
Response
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
Include all deputies (ignore pagination)
Number of records to skip
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
Citizen ID to link to deputy
Deputy callsign (e.g., “E-101”)
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
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
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
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
Record type: MEDICATION, ALLERGY, CONDITION, etc.
Medical record description
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
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
Medical conditions observed
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
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
Total number of dead citizens
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
Request Body
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
Filter by specific deputy ID
Only show current user’s logs
Response
Array of log objects with start/end times