# 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](https://docs.bace-iot.com/api/advanced-features "mention")

## 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.
