# Termination

Terminating an unused Soracom IoT SIM permanently.

When you no longer need your Soracom IoT SIM, you can terminate the subscription from the User Console, or programmatically using the Soracom API, Soracom CLI, or Metadata Service. Termination also gives you the ability to remotely terminate an IoT SIM, in order to prevent misuse and unwanted billing in case of loss.

> [!NOTE]
>
> Terminating a Soracom IoT SIM is a permanent, irreversible action. Once an IoT SIM is terminated, it cannot be used for network connections or SMS functionality, and it cannot be re-activated. For security reasons, Soracom staff can not terminate SIMs on the behalf of customers.

## Before Terminating an IoT SIM

Terminating an IoT SIM does not necessarily stop the device using it from attempting to connect to the cellular network.

Before terminating an IoT SIM, power off the device using it or confirm that the device is configured to stop reconnecting after the network rejects the connection. A device that repeatedly attempts to reconnect after its IoT SIM is terminated generates repeated signaling to the cellular base station, which can tie up network resources.

> [!NOTE]
>
> If Soracom detects repeated connection attempts from a device using a terminated IoT SIM, Soracom may contact you and ask you to power off the device.

## Terminating a SIM

1. Sign in to the **[User Console](https://console.soracom.io/?coverage_type=g)**. From the **☰ Menu**, open the **SIM Management** screen.

2. From the list of subscribers, click the **☑** for the SIM you want to terminate.

3. Click the **Actions ▾** menu, then select **Terminate**.

   ![Terminate](https://docs.soracom.io/_astro/terminate.CLVyqCFJ_Z1CfzBf.webp)

4. A warning will appear to confirm the action. If you have Termination Protection enabled, you will be required to disable it before terminating the SIM. Click **Terminate** to confirm.

   ![Terminate SIM](https://docs.soracom.io/_astro/terminate-sim.17KTeLHO_ZtLaI6.webp)

Once your SIM has been terminated, it will remain visible in your account for a certain period of time, and automatically be removed afterwards.

## Termination Protection

To prevent accidental termination, you can enable the **Termation protection** option. With Termination protection enabled, you will be asked to disable protection in order to confirm the termination action.

To enable Termination protection:

1. Sign in to the **[User Console](https://console.soracom.io/?coverage_type=g)**. From the **☰ Menu**, open the **SIM Management** screen.

2. From the list of subscribers, click the **☑** for the SIM you want to modify.

3. Click the **Actions ▾** menu, then select **Change termination protection**.

   ![Change termination protection](https://docs.soracom.io/_astro/change-termination-protection.D8X-5k_z_mAaep.webp)

4. From the **Change termination protection** dialog, click the toggle button to turn **Termination Protection ON**, then click **Change**.

   ![Termination Protection](https://docs.soracom.io/_astro/termination-protection.D9x50Ma6_1qYXsw.webp)

## Programmatic Usage

You can terminate SIMs and enable or disable termination protection using the Soracom API, Soracom CLI, and Metadata Service.

### Soracom API

To access the Soracom API, first use the [**auth**](https://docs.soracom.io/en/api#!/Auth/auth) API to obtain an API Key and Token. Refer to the [**API Usage Guide**](https://docs.soracom.io/en/developers/soracom-api) for instructions on how to use the API Key and Token in API requests.

Then, use the [terminateSim](https://docs.soracom.io/en/api#!/Sim/terminateSim) API to terminate an IoT SIM:

**Global**

```bash
curl -X POST \
  -H 'X-Soracom-API-Key: <MY-API-KEY>' \
  -H 'X-Soracom-Token: <MY-TOKEN>' \
  https://g.api.soracom.io/v1/sims/<SIM-ID>/terminate
```

**Japan**

```bash
curl -X POST \
  -H 'X-Soracom-API-Key: <MY-API-KEY>' \
  -H 'X-Soracom-Token: <MY-TOKEN>' \
  https://jp.api.soracom.io/v1/sims/<SIM-ID>/terminate
```

Enabling or disabling termination protection is done similarly with the following APIs:

- [enableSimTermination](https://docs.soracom.io/en/api#!/Sim/enableSimTermination)
- [disableSimTermination](https://docs.soracom.io/en/api#!/Sim/disableSimTermination)

### Soracom CLI

Then, run the following command to terminate an IoT SIM:

**Global**

```bash
soracom sims terminate --sim-id <SIM-ID> --coverage-type g
```

**Japan**

```bash
soracom sims terminate --sim-id <SIM-ID> --coverage-type jp
```

Enabling or disabling termination protection is done similarly with the following commands:

- `soracom sims enable-termination`
- `soracom sims disable-termination`

### Metadata Service

The Metadata Service allows an Air SIM device to access and configure its own settings without the need for authentication. For more information, refer to the [**Metadata Service**](https://docs.soracom.io/en/services/air/metadata-service) documentation.

In order for an IoT SIM to terminate its own subscription or modify its termination protection setting, the Metadata Service **Readonly** option must be disabled. Then, use the same endpoints that correspond to the Soracom **Subscriber** API.

To make an IoT SIM terminate its own subscription, use the [terminateSubscriber](https://docs.soracom.io/en/api#!/Subscriber/terminateSubscriber) API:

```bash
curl -X POST http://metadata.soracom.io/v1/subscriber/terminate
```

> [!NOTE]
>
> When calling the **terminateSubscriber** API, the subscription will be terminated and the device will no longer be able to connect.

Enabling or disabling termination protection is done similarly with the following APIs:

- [enableTermination](https://docs.soracom.io/en/api#!/Subscriber/enableTermination)
- [disableTermination](https://docs.soracom.io/en/api#!/Subscriber/disableTermination)
