curl --request PATCH \
--url https://api.spenza.com/api/v1.1/sims/{iccid}/service-state \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice": true,
"sms": true,
"data": false
}
'import requests
url = "https://api.spenza.com/api/v1.1/sims/{iccid}/service-state"
payload = {
"voice": True,
"sms": True,
"data": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({voice: true, sms: true, data: false})
};
fetch('https://api.spenza.com/api/v1.1/sims/{iccid}/service-state', 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.spenza.com/api/v1.1/sims/{iccid}/service-state",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'voice' => true,
'sms' => true,
'data' => false
]),
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.spenza.com/api/v1.1/sims/{iccid}/service-state"
payload := strings.NewReader("{\n \"voice\": true,\n \"sms\": true,\n \"data\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.spenza.com/api/v1.1/sims/{iccid}/service-state")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voice\": true,\n \"sms\": true,\n \"data\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v1.1/sims/{iccid}/service-state")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voice\": true,\n \"sms\": true,\n \"data\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"iccid": "8901260853182965429",
"serviceState": {
"voice": true,
"sms": true,
"data": null
}
}
}Enable or disable voice, SMS, and/or data on a SIM
Enable or disable voice, SMS, and/or data on a SIM’s line without
canceling its subscription. Provide at least one of voice, sms,
data — omitting all three is a 400; each field is independently
optional, so a request can target just one.
Toggling voice/sms also requires the SIM’s active (or
cancel-scheduled) plan to include that capability — a plan with no
voice allowance can’t have voice toggled here, regardless of the
operator’s own support for it. data isn’t actionable by any
operator yet: a request containing only data returns 501, and
a mixed request (e.g. voice + data) applies the supported fields
and reports data back in a warnings array instead of silently
dropping it.
serviceState.voice/.sms in the response reflect the operator’s
full current state after the update, not just what this call
changed — persist it directly rather than merging locally.
serviceState.data is always null today, since no operator can
report it.
curl --request PATCH \
--url https://api.spenza.com/api/v1.1/sims/{iccid}/service-state \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice": true,
"sms": true,
"data": false
}
'import requests
url = "https://api.spenza.com/api/v1.1/sims/{iccid}/service-state"
payload = {
"voice": True,
"sms": True,
"data": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({voice: true, sms: true, data: false})
};
fetch('https://api.spenza.com/api/v1.1/sims/{iccid}/service-state', 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.spenza.com/api/v1.1/sims/{iccid}/service-state",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'voice' => true,
'sms' => true,
'data' => false
]),
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.spenza.com/api/v1.1/sims/{iccid}/service-state"
payload := strings.NewReader("{\n \"voice\": true,\n \"sms\": true,\n \"data\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.spenza.com/api/v1.1/sims/{iccid}/service-state")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voice\": true,\n \"sms\": true,\n \"data\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v1.1/sims/{iccid}/service-state")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voice\": true,\n \"sms\": true,\n \"data\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"iccid": "8901260853182965429",
"serviceState": {
"voice": true,
"sms": true,
"data": null
}
}
}Authorizations
Bearer token obtained from POST /api/v1.1/auth/token.
Headers
Any string unique to this logical request. On a retry with the same key
and the same request body, the original response is replayed verbatim
(with an Idempotency-Replayed: true response header) instead of the
action repeating. Reusing the key with a different body or on a
different route returns 409 IDEMPOTENCY_KEY_REUSED. A replay attempted
while the original call is still in flight returns 409 CONFLICT.
Optional — omit it and the endpoint behaves exactly as it would otherwise.
"a1b2c3d4-idem-key-001"
Path Parameters
SIM ICCID.
"8901260853182965429"
Body
Response
Service state updated (or partially — see warnings).

