> For the complete documentation index, see [llms.txt](https://docs.antsomi.com/api-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.antsomi.com/api-guide/endpoint/event-api/get-event-history.md).

# Get Event History

Retrieve the historical data and details of a specific event that's undertaken by a customer in CDP.

<mark style="color:blue;">`GET`</mark> `http://api.ants.tech/access/api/event/history`

#### Query Parameters

| Name                                           | Type   | Description                                                                                                                                                                                 |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| customer\_id<mark style="color:red;">\*</mark> | String | The unique identifier of the customer whose historical events you want to retrieve. For example, `70`                                                                                       |
| limit                                          | Number | Allows you to control the number of results returned in a response. For example, `100`                                                                                                      |
| event\_filters                                 | String | Allows you to filter the returned results. Currently, we only allow filtering using the event-unique identifier (i.e., `event_``name)`. For example, `[{"event_name": "sync_transaction"}]` |

#### Headers

| Name                                            | Type   | Description             |
| ----------------------------------------------- | ------ | ----------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer `<ACCESS_TOKEN>` |

{% tabs %}
{% tab title="200: OK The request is successful, the server responds with a list of event historical data." %}

```json
{
    "nodeName": "10.200.0.4:8200",
    "msg": "OK",
    "code": 200,
    "portal_timezone": "Asia/Bangkok",
    "user_ids": {
        "type": "anynomous_user",
        "list": [
            "1171039745",
            "1210703653",
            "1210704253"
        ]
    },
    "description": "get history is success",
    "is_cached": false,
    "history": [
        {
            "eventId": 2029940388068957000,
            "loggedTime": 1692172548000,
            "trackedTime": 1692172548000,
            "loggedDateTime": "2023-08-16 15:55:48",
            "trackedDateTime": "2023-08-16 14:55:48",
            "trackedDateTimeUTC": "2023-08-16 07:55:48",
            "portalId": 564244922,
            "propertyId": 564244923,
            "userId": "1210704253",
            "sessionId": 3711854758,
            "eventTrackingName": "",
            "eventCategory": "user",
            "eventAction": "exit_intent",
            "eventCategoryId": 5,
            "eventActionId": 312263,
            "eventValue": 0,
            "deviceTypeId": 1,
            "extra": {
                "prop_id": "564244923",
                "trackid": "d83da832-c5a3-4f9e-ae02-ef0f9fbddfc3",
                "utm_type": "direct",
                "atm_type": "on_session",
                "ip_address": "115.79.137.249",
                "is_webview": false,
                "location_url": "https://magento.antsomi.com/",
                "click_id": "70_1b1687918046",
                "atm_source": "กินผลไม้ไทย",
                "is_rt_evt": false,
                "identify_type": "predict",
                "click_bc": "70_1b1687918046",
                "utm_source": "กินผลไม้ไทย",
                "customers": {
                    "customer_id": "70"
                },
                "title": ""
            },
            "dims": null,
            "items": null,
            "context": {
                "country": "vn",
                "os": "Mac OS",
                "province_id": 29,
                "ip": "115.79.137.249",
                "browser": "Chrome",
                "dev_type": "Personal computer",
                "page": {
                    "id": "8243723773127059811",
                    "title": "",
                    "url": "https://magento.antsomi.com/"
                }
            }
        },
        {
            "eventId": 4689528677810448000,
            "loggedTime": 1692172295000,
            "trackedTime": 1692172295000,
            "loggedDateTime": "2023-08-16 15:51:35",
            "trackedDateTime": "2023-08-16 14:51:35",
            "trackedDateTimeUTC": "2023-08-16 07:51:35",
            "portalId": 564244922,
            "propertyId": 564244923,
            "userId": "1171039745",
            "sessionId": 3831796330,
            "eventTrackingName": "",
            "eventCategory": "user",
            "eventAction": "exit_intent",
            "eventCategoryId": 5,
            "eventActionId": 312263,
            "eventValue": 0,
            "deviceTypeId": 1,
            "extra": {
                "prop_id": "564244923",
                "trackid": "d83da832-c5a3-4f9e-ae02-ef0f9fbddfc3",
                "utm_type": "direct",
                "atm_type": "on_session",
                "ip_address": "115.79.137.249",
                "is_webview": false,
                "location_url": "https://magento.antsomi.com/",
                "click_id": "70_1b1687918046",
                "atm_source": "กินผลไม้ไทย",
                "is_rt_evt": false,
                "identify_type": "predict",
                "visitor_type": "returning",
                "click_bc": "70_1b1687918046",
                "utm_source": "กินผลไม้ไทย",
                "customers": {
                    "customer_id": "70"
                },
                "title": ""
            },
            "dims": null,
            "items": null,
            "context": {
                "country": "vn",
                "os": "Mac OS",
                "province_id": 29,
                "ip": "115.79.137.249",
                "browser": "Chrome",
                "dev_type": "Personal computer",
                "page": {
                    "id": "8243723773127059811",
                    "title": "",
                    "url": "https://magento.antsomi.com/"
                }
            }
        }
    ],
    "customer_id": "70",
    "time_lost": "97 ms",
    "version": "20210615",
    "status": true
}
```

{% endtab %}

{% tab title="404: Not Found The request is failed, the provided customer\_id is not valid or the event history does not exist." %}

```json
{
    "msg": "Not Found",
    "code": 404,
    "description": "Not found any audience mapping with this customer",
    "status": false
}
```

{% endtab %}

{% tab title="403: Forbidden The authorization process is failed, caused by an invalid token, an expired token or a token without the valid scope." %}

```json
{
    "code": 301,
    "message": "Permission denied",
    "data": "You don't have permission to access this request!"
}
```

{% endtab %}
{% endtabs %}
