# Unread events

## API actions

API path: `/history/unread`.

### list

List less than or equal to `limit` of the latest user's unread history events. Described how it works in our [guide](/docs/navixy-api/user-api/backend-api/guides/rules-notifications/work-with-notifications.md#all-unread-events-of-a-user).

#### Parameters

| name  | description                                                                                                                               | type      |
| ----- | ----------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| limit | Optional. Limit of entries in response.                                                                                                   | int       |
| from  | Optional. Start [date/time](/docs/navixy-api/user-api/backend-api.md#data-types) for searching. Default `from` is **now** minus one year. | date/time |

Default and max limit is [history.maxLimit](/docs/navixy-api/user-api/backend-api/resources/commons/dealer.md).

#### Examples

{% tabs %}
{% tab title="cURL" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/history/unread/list' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
```

{% endtab %}

{% tab title="HTTP GET" %}
{% code overflow="wrap" %}

```http
https://api.eu.navixy.com/v2/history/unread/list?hash=a6aa75587e5c59c32d347da438505fc3
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Response

```json
{
  "success": true,
  "list": [
    {
      "id": 1,
      "type": "tracker",
      "is_read": false,
      "message": "Alarm",
      "time": "2020-01-01 00:00:00",
      "event": "offline",
      "tracker_id": 2,
      "rule_id": 3,
      "track_id": 4,
      "location": {
        "lat": 50.0,
        "lng": 60.0,
        "precision": 50
      },
      "address": "address",
      "extra": {
        "task_id": null,
        "parent_task_id": null,
        "counter_id": null,
        "service_task_id": null,
        "checkin_id": null,
        "place_ids": null,
        "last_known_location": false,
        "tracker_label": "Tracker label",
        "emergency": false,
        "employee_id": 4563
      }
    }
  ]
}
```

* `list` - array of objects. list of zero or more [Tracker history entry](/docs/navixy-api/user-api/backend-api/resources/commons/history/index.md#tracker-history-entry) objects.

#### Errors

* 212 – Requested limit is too big (more [history.maxLimit](/docs/navixy-api/user-api/backend-api/resources/commons/dealer.md) config option).

### `count`

Get count of user's unread history messages starting `from` date.

#### Parameters

| name | description                                                                                                                               | type                                                        |
| ---- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| from | Optional. Start [date/time](/docs/navixy-api/user-api/backend-api.md#data-types) for searching. Default `from` is **now** minus one year. | date/time                                                   |
| type | Optional. Type of devices that should be count. Can be "socket", "tracker", or "camera".                                                  | [enum](/docs/navixy-api/user-api/backend-api.md#data-types) |

#### Examples

{% tabs %}
{% tab title="cURL" %}

```sh
curl -X POST 'https://api.eu.navixy.com/v2/history/unread/count' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
```

{% endtab %}

{% tab title="HTTP GET" %}
{% code overflow="wrap" %}

```http
https://api.eu.navixy.com/v2/history/unread/count?hash=a6aa75587e5c59c32d347da438505fc3
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Response

```json
{
  "success": true,
  "count": 1
}
```

#### Errors

* [General](/docs/navixy-api/user-api/backend-api/errors.md#error-codes) types only.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://navixy.com/docs/navixy-api/user-api/backend-api/resources/commons/history/history_unread.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
