# eSIM API - Events

> Retrieve the end-to-end lifecycle event history of an eSIM so you and your support team can see what happened to it.

Canonical: https://docs.getroamify.com/esims/events/

## eSIM Events
This is a super handy feature to get eSIM lifecycle events end-to-end when applicable. It will help you and your support team understand the history of the eSIM with a series of events.

## Get eSIM Events
To get the list of eSIM events, you need to send a `GET` request to the `/api/esim/event` endpoint.

The query parameters should contain one of the following parameters:
- `iccid`: The ICCID of the eSIM.
- `esimId`: The esimId provided by Roamify.
- `referenceId`: The referenceId provided by you when creating the order.

> **Warning:** At least one of `iccid`, `esimId`, or `referenceId` is required.

### Usage - get eSIM events with ICCID
Here is an example of how you can get eSIM events using ICCID

**curl**

```bash
curl --request GET \
--url 'https://api-dev.getroamify.com/api/esim/event?iccid={your iccid}' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
```

**javascript**

```javascript
    const axios = require('axios');

    axios.get('https://api-dev.getroamify.com/api/esim/event?iccid={your_iccid}', {
    headers: {
    'Authorization': 'Bearer {access token here}',
    'Content-Type': 'application/json'
}
})
    .then(response => {
    console.log(response.data);
})
    .catch(error => {
    console.error(error);
});
```

### Sample Response
```json
{
	"iccid": "89851000000006262546",
	"esimId": "f6d83dcb-e7b5-45f7-8c1d-b2a07ebd49f4",
	"referenceId": "",
	"events": [
		{
			"iccid": "89851000000006262546",
			"eid": "89049032007008882600092301372109",
			"status": "INACTIVE",
			"timeStamp": 1756528206,
			"dateTime": "2025-08-30 04:30:06"
		},
		{
			"iccid": "89851000000006262546",
			"eid": "89049032007008882600092301372109",
			"status": "ACTIVATED",
			"timeStamp": 1756528208,
			"dateTime": "2025-08-30 04:30:08"
		},
		{
			"iccid": "89851000000006262546",
			"eid": "89049032007008882600092301372109",
			"status": "INACTIVE",
			"timeStamp": 1756528211,
			"dateTime": "2025-08-30 04:30:11"
		},
		{
			"iccid": "89851000000006262546",
			"eid": "89049032007008882600092301372109",
			"status": "ACTIVATED",
			"timeStamp": 1756528213,
			"dateTime": "2025-08-30 04:30:13"
		}
	],
	"locations": []
}
```
