Skip to content

Create a new incident

POST
/incidents
curl --request POST \
--url https://app.bluelightmaps.com/api/incidents \
--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": 1, "description": "Building fire reported", "resources": [ "P221", "A14" ] }'

Create a new incident in the system. The originId must be unique.

Each entry in resources is a callsign. A callsign is matched against the names of the devices the caller can reach, and a single callsign may map to several devices (a vehicle often carries more than one) - every one of them gets an incidentAssigned event and a push.

A new incident is always created with status: OPEN; status and timeClosed in the body are ignored here.

The 202 response reports one status per callsign: NOT_FOUND when no device carried it, OFFLINE when at least one of its devices was not online (that device’s push is queued for retry).

Media type application/json
object
id
integer format: int64
originId
required

Unique external identifier for the incident

string
type
required

Type of incident

string
timeOfOrigin

Time when the incident occurred

string format: date-time
timeReceived

Time when the incident was received by the system

string format: date-time
timeUpdated

Time when the incident was last updated

string format: date-time
status

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.

string
default: OPEN
Allowed values: OPEN CLOSED
timeClosed

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.

string format: date-time
latitude
required

Latitude of the incident location

number format: double
longitude
required

Longitude of the incident location

number format: double
priority
required

Priority of the incident

integer
description

Description of the incident

string
<= 255 characters
resources

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.

Array<string>
Examples
Example createIncident
{
"originId": "INC-123456",
"type": "FIRE",
"timeOfOrigin": "2023-05-10T08:45:00.000Z",
"latitude": 51.5074,
"longitude": -0.1278,
"priority": 1,
"description": "Building fire reported",
"resources": [
"P221",
"A14"
]
}

The created incident

Media type application/json
object
id
integer format: int64
originId
required

Unique external identifier for the incident

string
type
required

Type of incident

string
timeOfOrigin

Time when the incident occurred

string format: date-time
timeReceived

Time when the incident was received by the system

string format: date-time
timeUpdated

Time when the incident was last updated

string format: date-time
status

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.

string
default: OPEN
Allowed values: OPEN CLOSED
timeClosed

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.

string format: date-time
latitude
required

Latitude of the incident location

number format: double
longitude
required

Longitude of the incident location

number format: double
priority
required

Priority of the incident

integer
description

Description of the incident

string
<= 255 characters
resources

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.

Array<string>
Example
{
"status": "OPEN"
}

Incident created, but at least one callsign was not found or had a device that was not online

Media type application/json
object
incident
object
id
integer format: int64
originId
required

Unique external identifier for the incident

string
type
required

Type of incident

string
timeOfOrigin

Time when the incident occurred

string format: date-time
timeReceived

Time when the incident was received by the system

string format: date-time
timeUpdated

Time when the incident was last updated

string format: date-time
status

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.

string
default: OPEN
Allowed values: OPEN CLOSED
timeClosed

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.

string format: date-time
latitude
required

Latitude of the incident location

number format: double
longitude
required

Longitude of the incident location

number format: double
priority
required

Priority of the incident

integer
description

Description of the incident

string
<= 255 characters
resources

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.

Array<string>
message
string
details
object
deviceStatuses

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
key
additional properties
string
Allowed values: OFFLINE NOT_FOUND
Example
{
"incident": {
"status": "OPEN"
},
"details": {
"deviceStatuses": {
"additionalProperty": "OFFLINE"
}
}
}

Bad Request - Invalid data provided

The integration user is not allowed to create incidents

An incident with the same originId already exists