> This page is for Home.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emnify.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emnify.com/_mcp/server.

> Network attachment and location events in the emnify platform

| ID | Description                                   |
| :- | :-------------------------------------------- |
| 1  | [Update location](#update-location)           |
| 2  | [Update GPRS location](#update-gprs-location) |
| 15 | [Purge location](#purge-location)             |
| 16 | [Purge GPRS location](#purge-gprs-location)   |

### Update location

When a device attaches for the first time, it sends an authentication request.
This request is immediately followed by an `Update location` event.

After the first authentication, the device sends additional `Update location` events to inform the network about the current location.
This happens periodically or when entering a new location area.

The `Update location` event registers the device in the circuit-switched domain (2G/3G) and packet-switched domain (4G/LTE).
It enables the network to know the location/region of the device to send/retrieve the subscription information.
In 2G/3G it allows the device to send and receive SMS.

**Example**: a SIM card has (re)authenticated with a different network element.
If successful, the device appears as **Attached** in the [emnify Portal](/system-events/usage#emnify-portal) and is ready to receive SMS.

#### Example JSON response

```json maxLines=10
{
  "id": 176777623,
  "alert": false,
  "description": "New location received from VLR for IMSI='901430111111111', now
attached to VLR='491720000095'.",
  "timestamp": "2017-10-26T07:28:00.000+0000",
  "event_type": {
    "id": 1,
    "description": "Update location"
  },
  "event_source": {
    "id": 0,
    "description": "Network"
  },
  "event_severity": {
    "id": 0,
    "description": "Info"
  },
  "organisation": {
    "id": 215294,
    "name": "Demo Company"
  },
  "endpoint": {
    "id": 733023,
    "name": "GPS Tracker",
    "ip_address": "127.137.56.181",
    "tags": null,
    "imei": "732554536373291"
  },
  "imsi": {
    "id": 216476,
    "imsi": "401960166508658",
    "import_date": "2016-12-27T10:09:23.000+0000"
  },
  "sim": {
    "id": 2614385,
    "iccid": "3590376990354243198",
    "production_date": "2016-12-27T10:09:23.000+0000"
  },
  "detail": {
    "id": 3,
    "name": "Vodafone",
    "country": {
      "id": 74,
      "name": "Germany",
      "country_code": "49",
      "mcc": "262",
      "iso_code": "de"
    },
    "tapcode": [
      {
        "id": 2,
        "tapcode": "DEUD2"
      }
    ],
    "mnc": [
      {
        "id": 3,
        "mnc": "02"
      }
    ]
  }
}
```

### Update GPRS location

Similar to the [`Update location`](#update-location) event, the `Update GPRS location` event shows the registration on the packet-switched (PS) domain.
This event is also sent periodically or when changing the location area.

**Example**: a SIM card has successfully registered for data sessions with a different network element.

> **Info**
>
> A device can only establish a data session after registering on the PS domain.

#### Example JSON response

```json maxLines=10
{
  "timestamp": "2021-10-24T12:44:09.901Z",
  "alert": false,
  "description": "New location received from SGSN for IMSI='668507304809640', now attached to SGSN='569307110740151', IP='213.181.60.148'.",
  "id": 158057547412841,
  "event_type": {
    "id": 2,
    "description": "Update GPRS location"
  },
  "event_source": {
    "id": 0,
    "description": "Network"
  },
  "event_severity": {
    "id": 0,
    "description": "Info"
  },
  "organisation": {
    "id": 35030,
    "name": "Test Org"
  },
  "endpoint": {
    "id": 11396946,
    "imei": "818076512105738",
    "ip_address": "163.93.166.228",
    "name": "Test Sim 2",
    "tags": null
  },
  "sim": {
    "iccid": "14610948273291945919",
    "id": 1748517,
    "production_date": "2020-12-23T13:02:11.000Z"
  },
  "imsi": {
    "id": 322634,
    "import_date": "2020-12-23T13:02:11.000Z",
    "imsi": "668507304809640"
  },
  "detail": {
    "id": 3,
    "name": "Vodafone",
    "country": {
      "id": 74,
      "name": "Germany",
      "country_code": "49",
      "mcc": "262",
      "iso_code": "de"
    },
    "tapcode": [
      {
        "id": 2,
        "tapcode": "DEUD2"
      }
    ],
    "mnc": [
      {
        "id": 3,
        "mnc": "02"
      }
    ]
  }
}
```

### Purge location

The `Purge location` event can be sent by the visited or home network to delete all location information for the circuit-switched (CS) domain.

The visited network may send this event if the device is unreachable or switched off for a longer period, indicating to the home network that the device is unavailable.

The home network (emnify) may send this event to delete all information on the visited network, so the device needs a new authentication.

Once executed, the [connectivity status](https://www.emnify.com/iot-glossary#connectivity-status) appears as **Offline** in the [emnify Portal](/system-events/usage#emnify-portal).

**Example**: the network deletes the routing information for a mobile-terminated call or mobile-terminated short message and marks the device not reachable.

#### Example JSON response

```json maxLines=10
{
  "timestamp": "2021-10-27T10:49:23.673Z",
  "alert": false,
  "description": "VLR location information has been purged for IMSI='674828638458881'.",
  "id": 5993503928,
  "event_type": {
    "id": 15,
    "description": "Purge location"
  },
  "event_source": {
    "id": 0,
    "description": "Network"
  },
  "event_severity": {
    "id": 0,
    "description": "Info"
  },
  "organisation": {
    "id": 58617,
    "name": "Test Org"
  },
  "endpoint": {
    "id": 16292274,
    "imei": "544699331267254",
    "ip_address": "88.8.18.46",
    "name": "Test Sim 2",
    "tags": null
  },
  "sim": {
    "iccid": "71247175489021804405",
    "id": 1135076,
    "production_date": "2020-12-23T13:02:11.000Z"
  },
  "imsi": {
    "id": 8245866,
    "import_date": "2020-12-23T13:02:11.000Z",
    "imsi": "674828638458881"
  }
}
```

### Purge GPRS location

Similar to the [`Purge location`](#purge-location) event, the `Purge GPRS location` event deletes all state information in the visited or home network but for the packet-switched (PS) domain.

#### Example JSON response

```json maxLines=10
{
  "timestamp": "2021-10-24T12:43:51.486Z",
  "alert": false,
  "description": "SGSN location information has been purged for IMSI='67282840195069'.",
  "id": 311518630325,
  "event_type": {
    "id": 16,
    "description": "Purge GPRS location"
  },
  "event_source": {
    "id": 0,
    "description": "Network"
  },
  "event_severity": {
    "id": 0,
    "description": "Info"
  },
  "organisation": {
    "id": 4218,
    "name": "Test Org"
  },
  "endpoint": {
    "id": 11914780,
    "imei": "796069824764979",
    "ip_address": "46.127.35.53",
    "name": "Test Sim 2",
    "tags": null
  },
  "sim": {
    "iccid": "5061064643679211967",
    "id": 3686752,
    "production_date": "2020-12-23T13:02:11.000Z"
  },
  "imsi": {
    "id": 78713389,
    "import_date": "2020-12-23T13:02:11.000Z",
    "imsi": "67282840195069"
  }
}
```