Knaq API v1

GET /1/alerts

Returns alerts of an equipment collection within a specified date range.


Endpoint URL

https://api.knaq.io/1/alerts

Authentication

Authorization request header Bearer token

Query parameters

Name Type Description
start_date string All alerts returned will have incident_at after this date.

Required. This date is inclusive. The value provided is in the format "yyyy-mm-dd", indicating a specific year, month, and day.
end_date string All alerts returned will have incident_at before this date.

Required. This date is inclusive. The value provided is in the format "yyyy-mm-dd", indicating a specific year, month, and day.
building string Require at least one of building, department and device_id to be set.
department string Require at least one of building, department and device_id to be set.
device_id string Require at least one of building, department and device_id to be set.

Note: The maximum query duration is 31 days. The maximum number of alerts returned within the time range is 1000.

Example responses

{
  "alerts": [
    {
      "id": "org12345",
      "device_id":"00010001-0001-0001-0001-000100010001",
      "building": "123 Main Street",
      "equipment_name": "PE 1",
      "alert_type": "input",
      "incident_at": "2023-03-01 19:18:01",
      "recovered_at": "2023-03-02 05:30:24",
      "description": "input name: inspection",
      "is_planned": true,
      "unplanned_category": "mechanical",
      "user_notes": "Mechanic making repairs"
    }
  ]
}
{
  "error": {
    "code": "InvalidRequestQueryParameters",
    "message": ""
  }
}

Response fields

Name Type Description
id string Unique identifier of this alert.
device_id string Unique identifier of this equipment.
building string The building or equipment location.
equipment_name string The name or label assigned to this equipment.
alert_type string The alert type.

Supported values:
  • shutdown_watch
  • escalator_motor
  • input
  • power_loss
  • maintenance
  • door_open
incident_at date The alert start time.
recovered_at date The alert recovery time.
description string Additional information for this alert.

When alert_type is input, this includes the input name.
When alert_type is door_open, this includes the alert threshold.
is_planned boolean Indicates if this alert is created under planned or scheduled maintenance.
unplanned_category string Assigned category for an unplanned alert.

Supported values:
  • uncategorized
  • mechanical
  • vandalism
  • environmental
  • power
  • accident
user_notes string User notes added to this alert.