Get the Smart Alert metrics
# Retrieve Smart Alert Metrics ### `POST /dm/v1/smartAlerts/actions/metrics` Use this endpoint to retrieve metrics for smart alerts sent for a recent daily period, up to 30 days. ## Header Parameters The request header must set the content-type to JSON, contain a current ThingSpace authorization token and a current VZ-M2M session token. For more details on how to get these tokens, visit [Getting Started](https://thingspace.verizon.com/documentation/api-documentation.html#/http/connectivity-management/guides/getting-started/introduction-to-the-connectivity-management-api). |Parameter Name|Data Type|Description| |-----|-----|-----| | **Authorization** *(required)* | string | HTTP Authorization request header containing a valid Bearer token: `Authorization: Bearer {token}` | | **VZ-M2M-Token** *(required)* | string | A valid session token returned by a Connectivity Management `POST /session/login` request. | | **Content-Type** *(required)* | string | Must be `application/json`. | ## HTTP Request [POST https://thingspace.verizon.com/api/dm/v1/smartAlerts/actions/metrics](/docs/specialized-apis/sensor-insights/api-endpoints/smart-alerts/sensorinsightsmetricsquery) ## Request Parameters **Note:** All parameters are required unless marked *(optional)* | Parameter | Data Type | Description | | ---------- | --------- | ------------ | | **days** | integer | The period of days to query. This value is for days up to the day the request is made. | ## Request Body Example Request: ```json { "days": 30 } ``` ## Success Response **Status 200** This is a synchronous response, so the tallies of smart alerts received in the period specified will be returned. Example Response: ```json { "critical": 0, "major": 0, "minor": 0, "noalert": 1, "total": 1, "deltacritical": -3, "deltamajor": -1, "deltaminor": 0, "deltanoalert": -15 } ``` ## Success Parameters | Parameter | Data Type | Description | | ---------- | -------- | ----------- | | **critical** | integer | The number of critical alerts in the time period queried. | | **major** | integer | The number of major alerts in the time period queried. | | **minor** | integer | the number of minor alerts in the time period queried. | | **noalert** | integer | The number of times a sensor reported with no alerts in the time period queried. | | **total** | integer |The total number of alerts in the time period queried. | | **deltacritical** | integer | The change in the number of critical alerts reported in the time period queried.| | **deltamajor** | integer | The change in the number of major alerts reported in the time period queried.| | **deltaminor** | integer | The change in the number of minor alerts reported in the time period queried. | | **deltanoalert** | integer | The change in the number of times a sensor reported with no alerts in the time period queried. | ## Failure Responses Example Response: ```json { "error": "Error name or code", "error_description": "A longer error description.", "cause": "A cause for the error" } ```