Update an incident by originId
const url = 'https://app.bluelightmaps.com/api/incidents/update';const options = { method: 'PUT', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"originId":"INC-123456","type":"FIRE","timeOfOrigin":"2023-05-10T08:45:00.000Z","latitude":51.5074,"longitude":-0.1278,"priority":2,"description":"Building fire reported","resources":["P221","A14"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://app.bluelightmaps.com/api/incidents/update \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "originId": "INC-123456", "type": "FIRE", "timeOfOrigin": "2023-05-10T08:45:00.000Z", "latitude": 51.5074, "longitude": -0.1278, "priority": 2, "description": "Building fire reported", "resources": [ "P221", "A14" ] }'Update an incident identified by its originId rather than its database ID. This is useful for integrations where the database ID may not be known, but the incident’s originId is available.
This is a full replacement, not a partial update. Every stored column is overwritten from the request body. Only description, timeOfOrigin, timeReceived, status and timeClosed are carried over from the stored incident when omitted; any other omitted field is written as empty (priority becomes 0, coordinates become 0, and an omitted type fails the request). An omitted resources array is treated as an empty one and stands every callsign currently on the incident down. Always send the complete incident.
The server diffs the old and new resources lists: added callsigns get an incidentAssigned event and push, removed callsigns get an incidentDeassigned event and push, unchanged callsigns are left alone. Each entry is a callsign matched against the names of the devices the caller can reach, and one callsign may resolve to several devices - every one of them is notified.
Closing and reopening. status is OPEN or CLOSED; omit it to keep the stored value. Any other value is a 400. Setting it to CLOSED stamps timeClosed, empties resources, and sends every callsign still on the incident an incidentDeassigned event and push carrying the extra event attribute incidentStatus: CLOSED, so the app can tell a closure from a reassignment. Setting it back to OPEN reopens the incident, clears timeClosed and diffs resources as usual. Sending a non-empty resources array while the incident is (or stays) closed is a 409. timeClosed is server-owned and ignored in the body.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Unique external identifier for the incident
Type of incident
Time when the incident occurred
Time when the incident was received by the system
Time when the incident was last updated
Lifecycle state. Incidents are created OPEN; status in a create body is ignored. On an update, omit it to keep the stored value, send CLOSED to close (which stands every remaining callsign down and stamps timeClosed) or OPEN to reopen (which clears timeClosed). Any other value is a 400, and assigning resources while closed is a 409.
When the incident was closed; absent (null) while it is open. Server-owned: set when status becomes CLOSED, cleared when it goes back to OPEN, and ignored if sent in a request body.
Latitude of the incident location
Longitude of the incident location
Priority of the incident
Description of the incident
Callsigns assigned to this incident. A callsign is matched against the names of the devices the caller can reach, and one callsign may map to several devices (a vehicle often carries more than one) - each of them receives the assignment / deassignment event and push. Always empty while the incident is closed.
Examples
Re-prioritise (full object, resources unchanged)
{ "originId": "INC-123456", "type": "FIRE", "timeOfOrigin": "2023-05-10T08:45:00.000Z", "latitude": 51.5074, "longitude": -0.1278, "priority": 2, "description": "Building fire reported", "resources": [ "P221", "A14" ]}Swap a callsign (Command Unit off, Mobile Command on)
{ "originId": "INC-123456", "type": "FIRE", "timeOfOrigin": "2023-05-10T08:45:00.000Z", "latitude": 51.5074, "longitude": -0.1278, "priority": 2, "description": "Building fire reported", "resources": [ "P221", "P309" ]}Stand every callsign down, leaving the incident open
{ "originId": "INC-123456", "type": "FIRE", "timeOfOrigin": "2023-05-10T08:45:00.000Z", "latitude": 51.5074, "longitude": -0.1278, "priority": 2, "description": "Stop message, all units released", "resources": []}Close the incident: stands every remaining callsign down and stamps timeClosed
{ "originId": "INC-123456", "type": "FIRE", "timeOfOrigin": "2023-05-10T08:45:00.000Z", "latitude": 51.5074, "longitude": -0.1278, "priority": 2, "description": "Incident closed", "status": "CLOSED", "resources": []}Responses
Section titled “ Responses ”The updated incident
object
Unique external identifier for the incident
Type of incident
Time when the incident occurred
Time when the incident was received by the system
Time when the incident was last updated
Lifecycle state. Incidents are created OPEN; status in a create body is ignored. On an update, omit it to keep the stored value, send CLOSED to close (which stands every remaining callsign down and stamps timeClosed) or OPEN to reopen (which clears timeClosed). Any other value is a 400, and assigning resources while closed is a 409.
When the incident was closed; absent (null) while it is open. Server-owned: set when status becomes CLOSED, cleared when it goes back to OPEN, and ignored if sent in a request body.
Latitude of the incident location
Longitude of the incident location
Priority of the incident
Description of the incident
Callsigns assigned to this incident. A callsign is matched against the names of the devices the caller can reach, and one callsign may map to several devices (a vehicle often carries more than one) - each of them receives the assignment / deassignment event and push. Always empty while the incident is closed.
Example
{ "status": "OPEN"}Incident updated, but at least one callsign was not found or had a device that was not online
object
object
Unique external identifier for the incident
Type of incident
Time when the incident occurred
Time when the incident was received by the system
Time when the incident was last updated
Lifecycle state. Incidents are created OPEN; status in a create body is ignored. On an update, omit it to keep the stored value, send CLOSED to close (which stands every remaining callsign down and stamps timeClosed) or OPEN to reopen (which clears timeClosed). Any other value is a 400, and assigning resources while closed is a 409.
When the incident was closed; absent (null) while it is open. Server-owned: set when status becomes CLOSED, cleared when it goes back to OPEN, and ignored if sent in a request body.
Latitude of the incident location
Longitude of the incident location
Priority of the incident
Description of the incident
Callsigns assigned to this incident. A callsign is matched against the names of the devices the caller can reach, and one callsign may map to several devices (a vehicle often carries more than one) - each of them receives the assignment / deassignment event and push. Always empty while the incident is closed.
object
Keyed by callsign. NOT_FOUND means no device the caller can reach carries that callsign; OFFLINE means at least one of its devices was not online, and that device’s push has been queued for retry. Callsigns whose devices were all online are omitted.
object
Example
{ "incident": { "status": "OPEN" }, "details": { "deviceStatuses": { "additionalProperty": "OFFLINE" } }}Bad Request - Invalid data provided
The integration user has no permission on this incident
Incident with specified originId not found
The incident is closed (or is being closed) and the body carries a non-empty resources array. Reopen it with status: OPEN first.