# Accessing Events

## Event Endpoint

The `event` endpoint provides information on events that have occurred in the BACE IoT platform. It returns a list of events and event details such as type, time, and description.

`event` endpoint has potential to return all events occurred in the system so it is strongly suggested to use filters explained in [Advanced Features](/api/advanced-features.md)

## Retrieve gateway and cloud events&#x20;

<mark style="color:blue;">`GET`</mark> `https://dashboard.bace-iot.com/api/v2/event`

Use this endpoint to get all events from all gateways or particular devices.

#### Query Parameters

| Name                    | Type   | Description                     |
| ----------------------- | ------ | ------------------------------- |
| filter\[source\_device] |        | filter by source device         |
| filter\[id\_event]      |        | filter by id\_event             |
| sort                    | String | sorting events by specification |

{% tabs %}
{% tab title="200: OK The request was successful and the events were returned" %}

```json
{
    "items": [
        {
            "id_event": 2204754,
            "id_group": "19a2d526-6219-4431-ab92-e6a1c091a5db",
            "source_device": "369e32b8-0db3-4f98-82d7-3bbb0c909b67",
            "from_device": 1,
            "event_type": "208",
            "event_type_label": "208 - Cloud connectivity changed",
            "event_type_description": "",
            "occurred_at": 1674828349,
            "value": "2",
            "datatype": null,
            "event_value_label": "Modem",
            "event_value_description": "Cellular connection in use"
        }
}
```

{% endtab %}

{% tab title="401: Unauthorized The request requires authentication and the provided credentials were invalid" %}

{% endtab %}
{% endtabs %}

### Response

The response will be a JSON array of events, with each event having the following attributes:

* **id\_event:** a unique identifier for the event.
* **id\_group**: the identifier of the group to which the event's source device belongs.
* **source\_device**: the identifier of the device that generated the event.
* **from\_device**: an identifier indicating whether the event was generated by a device or the cloud.
* **event\_type**: the type of event, represented by a numerical code.
* **event\_type\_label**: a human-readable label for the event type.
* **event\_type\_description**: a description of the event type.
* **occurred\_at**: the time at which the event occurred, represented as a Unix timestamp.
* **value**: the value associated with the event. Some events have multiple values that inform different situations. Always refer to event\_value\_label and event\_value\_description to understand what it is.
* **datatype**: the data type of the `value` field.
* **event\_value\_label**: a human-readable label for the event value.
* **event\_value\_description**: a description of the event value.


---

# 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://docs.bace-iot.com/api/accessing-events.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.
