---
title: Query IMEI
slug: query-imei
createdAt: 2026-02-05T09:33:58.280Z
---

## Purpose

Returns device IMEI information associated with the SIM specified in the \<iccid> element.

This request retrieves the most recently detected IMEI, when it was first recorded, and the previously recorded IMEI where available.

### Endpoint

```xml
POST https://api.m2miportal.com
Content-Type: application/xml
Accept: application/xml
```



### Request (XML)

```xml
<query-imei version="1" api-id="123456">
  <authentication>
    <username>username</username>
    <password>password</password>
  </authentication>
  <iccid>1234567890123456789</iccid>
</query-imei>
```

### Response (Success)

```xml
<query-imei-response api-id="123456">
  <api-outcome>Success</api-outcome>  
  <current-imei>359827045164210</current-imei>
  <last-change>22/03/2020 13:55:30</last-change>
  <previous-imei>862057044700000</previous-imei>
</query-imei-response>
```

### Response Elements



| Element          | Description                                                                                                   |
| ---------------- | ------------------------------------------------------------------------------------------------------------- |
| \<current-imei>  | The current 15-digit IMEI where available.                                                                    |
| \<last-change>   | The date and time when the current IMEI was first detected. Format: DD/MM/YYYY hh\:mm\:ss. All times are UTC. |
| \<previous-imei> | The previously recorded 15-digit IMEI where available.                                                        |

If no information is available for an element, it will be returned empty.
&#x20;For example, if a SIM has only ever been used in one device, \<previous-imei> will be empty.

### Behaviour Notes

- IMEI detection is network dependent. Not all networks support IMEI reporting.&#x20;
- Some networks only record the IMEI after certain events (for example, completion of a successful data session).&#x20;
- \<last-change> reflects when the IMEI was recorded by the network, not when the SIM was physically inserted into the device.&#x20;
- Some networks report IMEIs in a 16-digit format including a software version number. The API converts this to the standard 15-digit format (14 digits plus Luhn check digit) before returning it.

:::hint{type="info"}
## Response (Failure)

If a request cannot be processed, the response will include:

- api-outcome indicating failure&#x20;
- An error description explaining the reason&#x20;

Failure responses may occur due to:

- Invalid authentication credentials&#x20;
- Invalid or unknown identifiers (for example ICCID or MSISDN)&#x20;
- Invalid or missing parameters&#x20;
- Values not permitted for the specified SIM type or account configuration&#x20;
- Insufficient permissions&#x20;

Integrating systems should validate input data before submission and implement appropriate error handling and logging.
:::

