Create and set an APN for an eSIM subscription
curl --request POST \
--url https://api.mobilerun.ai/devices/{deviceId}/esim/apn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"apn": "<string>",
"mcc": "<string>",
"mnc": "<string>",
"name": "<string>",
"protocol": "<string>",
"roamingProtocol": "<string>",
"subId": 123,
"type": "<string>"
}
'import requests
url = "https://api.mobilerun.ai/devices/{deviceId}/esim/apn"
payload = {
"apn": "<string>",
"mcc": "<string>",
"mnc": "<string>",
"name": "<string>",
"protocol": "<string>",
"roamingProtocol": "<string>",
"subId": 123,
"type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
apn: '<string>',
mcc: '<string>',
mnc: '<string>',
name: '<string>',
protocol: '<string>',
roamingProtocol: '<string>',
subId: 123,
type: '<string>'
})
};
fetch('https://api.mobilerun.ai/devices/{deviceId}/esim/apn', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/devices/{deviceId}/esim/apn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'apn' => '<string>',
'mcc' => '<string>',
'mnc' => '<string>',
'name' => '<string>',
'protocol' => '<string>',
'roamingProtocol' => '<string>',
'subId' => 123,
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/devices/{deviceId}/esim/apn"
payload := strings.NewReader("{\n \"apn\": \"<string>\",\n \"mcc\": \"<string>\",\n \"mnc\": \"<string>\",\n \"name\": \"<string>\",\n \"protocol\": \"<string>\",\n \"roamingProtocol\": \"<string>\",\n \"subId\": 123,\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/devices/{deviceId}/esim/apn")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"apn\": \"<string>\",\n \"mcc\": \"<string>\",\n \"mnc\": \"<string>\",\n \"name\": \"<string>\",\n \"protocol\": \"<string>\",\n \"roamingProtocol\": \"<string>\",\n \"subId\": 123,\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/devices/{deviceId}/esim/apn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apn\": \"<string>\",\n \"mcc\": \"<string>\",\n \"mnc\": \"<string>\",\n \"name\": \"<string>\",\n \"protocol\": \"<string>\",\n \"roamingProtocol\": \"<string>\",\n \"subId\": 123,\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}SIM
Create and set an APN for an eSIM subscription
Creates an access point name (APN) from the request body and applies it to the given eSIM subscription. Type, protocol, and roaming protocol default to common values when omitted.
POST
/
devices
/
{deviceId}
/
esim
/
apn
Create and set an APN for an eSIM subscription
curl --request POST \
--url https://api.mobilerun.ai/devices/{deviceId}/esim/apn \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"apn": "<string>",
"mcc": "<string>",
"mnc": "<string>",
"name": "<string>",
"protocol": "<string>",
"roamingProtocol": "<string>",
"subId": 123,
"type": "<string>"
}
'import requests
url = "https://api.mobilerun.ai/devices/{deviceId}/esim/apn"
payload = {
"apn": "<string>",
"mcc": "<string>",
"mnc": "<string>",
"name": "<string>",
"protocol": "<string>",
"roamingProtocol": "<string>",
"subId": 123,
"type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
apn: '<string>',
mcc: '<string>',
mnc: '<string>',
name: '<string>',
protocol: '<string>',
roamingProtocol: '<string>',
subId: 123,
type: '<string>'
})
};
fetch('https://api.mobilerun.ai/devices/{deviceId}/esim/apn', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/devices/{deviceId}/esim/apn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'apn' => '<string>',
'mcc' => '<string>',
'mnc' => '<string>',
'name' => '<string>',
'protocol' => '<string>',
'roamingProtocol' => '<string>',
'subId' => 123,
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/devices/{deviceId}/esim/apn"
payload := strings.NewReader("{\n \"apn\": \"<string>\",\n \"mcc\": \"<string>\",\n \"mnc\": \"<string>\",\n \"name\": \"<string>\",\n \"protocol\": \"<string>\",\n \"roamingProtocol\": \"<string>\",\n \"subId\": 123,\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/devices/{deviceId}/esim/apn")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"apn\": \"<string>\",\n \"mcc\": \"<string>\",\n \"mnc\": \"<string>\",\n \"name\": \"<string>\",\n \"protocol\": \"<string>\",\n \"roamingProtocol\": \"<string>\",\n \"subId\": 123,\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/devices/{deviceId}/esim/apn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apn\": \"<string>\",\n \"mcc\": \"<string>\",\n \"mnc\": \"<string>\",\n \"name\": \"<string>\",\n \"protocol\": \"<string>\",\n \"roamingProtocol\": \"<string>\",\n \"subId\": 123,\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}subId comes from list-esim. Defaults when omitted: name takes the apn value; type is default,supl; protocol and roamingProtocol are IPV4V6.
On iOS the new APN becomes active immediately, replacing the previous one. On Android it is only created — and the response doesn’t return its id — so call list-esim-apns to find it, then select-esim-apn to make it preferred.Authorizations
Bearer token via Authorization header
Headers
Required range:
x >= 0Path Parameters
Body
application/json
Response
No Content
Was this page helpful?
⌘I