# Takeover Protection (SIM Swap)

As part of CM.com's Takeover Protection measures, the Mobile Identity Services offer the option to detect a <<glossary:SIM>> swap. With this service you can check the last time the SIM of a provided phone number was swapped. SIM Swap has two different responses, depending on the `serviceType` in the request provided through the API.

* **timestamp**: Returns a time in `date-time` format specifying the last time the SIM was swapped for the provided phone number.
* **24h**: Returns `true` or `false` depending on if the phone number has had their SIM swapped in the past 24 hours.

## Request

**URL**

```
POST https://api.cm.com/mobile-identity/v1/sim-swap
```

**Headers**

```
Content-Type: application/json
Authorization: Bearer GENERATED_TOKEN_HERE
```

**Body**

```json
{
    "phoneNumber": "+31612345678",
    "serviceType": "timestamp"
}
```

### Parameters

| Property    | Type   | Required | Description                                                                                     |
| :---------- | :----- | :------- | :---------------------------------------------------------------------------------------------- |
| phoneNumber | string | Yes      | The phone number to be checked. This must be a valid phone number in <<glossary:E.164>> format. |
| serviceType | string | Yes      | The type of SIM Swap response to be retrieved. Available options are `timestamp` and `24h`.     |

## Response

Depending on the `serviceType` provided in the request, the response is different.

```json
{
    "state": "success",
    "timestamp": "2017-12-31T14:59:59Z"
}
```

### Parameters

Only one of the following properties will be returned.

| Property  | Example                | Description                                                                            |
| :-------- | :--------------------- | :------------------------------------------------------------------------------------- |
| timestamp | '2024-01-01T00:00:00Z' | Date and time of the last SIM Swap in ISO 8601 format.                                 |
| 24h       | false                  | `true` or `false` regarding whether the last SIM swap took place in the last 24 hours. |