---
title: "Switch eSIM Profile (JSON Stream)"
method: PATCH
path: "/assets/{asset_id}/alpon/esim"
tags: ["ALPON"]
---

# Switch eSIM Profile (JSON Stream)

`PATCH /assets/{asset_id}/alpon/esim`

## Request

- Base URL: `https://api.sixfab.com/v1`
- URL: `https://api.sixfab.com/v1/assets/{asset_id}/alpon/esim`
- Auth: API key in header `X-API-Key`

Switch the active eSIM profile on the ALPON device using JSON stream for real-time progress tracking.
The ICCID of the profile to switch to must be provided in the request body.

**Status Types:**
There are three types of status events:
- **Running:** The switching process is in progress.
- **Success:** The switching process was successful.
- **Fail:** The switching process failed.

Example of a running json stream:
```
{"status": "Running", "step": "ENABLE_PROFILE_CHECK_PROFILE_EXIST", "message": "Retrieving Profile", "progress": "20"}
```
Example of a successful json stream:
```
{"status": "Success", "step": "SUCCESS", "message": "Successfully switched profile: <iccid>", "progress": "100"}
```
Example of a failed json stream:
```
{"status": "Fail", "step": "ERROR", "message": "Error while switching eSIM profile.", "progress": "100"}
```



**Possible Error Codes:**
- **AssetNotFound:** The asset with the specified ID was not found.
- **AssetNotAlponDevice:** The device is not an ALPON device.
- **ErrorNoIccid:** ICCID not provided in the payload.
- **ErrorNoProfile:** No SIM profile found for the specified ICCID.
- **Unknown:** An unknown error occurred while switching eSIM profile.
- **DeviceNotReachable:** The device is not reachable.

## Path parameters

- `asset_id` string, required: Serial Number, UUID, SIM SID or SIM ICCID

## Headers

- `x-forwarded-for` string

## Request body

- SwitchESimProfileRequestModel
  - `iccid` string: ICCID of the SIM card to switch to.

## Response `200`

Server-Sent Events stream for switching eSIM profiles.

## Other responses

- `400`: Bad request, missing ICCID.
- `404`: Asset not found
- `422`: Validation Error
- `502`: Device not reachable

## Changes

- **2026-11-03** `5b43035c37ee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sixfab/apis/sixfab-developer-api/changes/assets/:asset_id/alpon/esim/patch.md)

---

[API](https://skmtc.dev/sixfab/apis/sixfab-developer-api.md) - [All operations](https://skmtc.dev/sixfab/apis/sixfab-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sixfab/apis/sixfab-developer-api/revisions/5b43035c37ee?raw)
