Update a notification preference
curl --request PUT \
--url https://api.spenza.com/api/v1.1/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'import requests
url = "https://api.spenza.com/api/v1.1/notification-preferences"
payload = { "enabled": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://api.spenza.com/api/v1.1/notification-preferences', 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/notification-preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true
]),
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/notification-preferences"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.spenza.com/api/v1.1/notification-preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v1.1/notification-preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"preferences": [
{
"eventType": "simAssignment",
"enabled": false
},
{
"eventType": "planPurchase",
"enabled": false
},
{
"eventType": "activatePlan",
"enabled": false
},
{
"eventType": "lowBalance",
"enabled": false
},
{
"eventType": "planExpiry",
"enabled": false
},
{
"eventType": "purchasePlanError",
"enabled": false
},
{
"eventType": "qrCodeForEsimActivation",
"enabled": false
},
{
"eventType": "sendQRCodeEmail",
"enabled": false
},
{
"eventType": "sendCancellationEmail",
"enabled": false
},
{
"eventType": "sendOnboardingNotification",
"enabled": true
}
]
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "One or more fields failed validation.",
"details": {
"validationErrors": [
"enabled must be a boolean value"
]
}
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Something went wrong on our end. Please contact Spenza support if this continues."
}
}Notifications
Update a notification preference
Enable or disable exactly one preference key per call — despite the plural resource name, this is a single-key update. Returns the full matrix so you can confirm without a follow-up GET.
PUT
/
api
/
v1.1
/
notification-preferences
Update a notification preference
curl --request PUT \
--url https://api.spenza.com/api/v1.1/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true
}
'import requests
url = "https://api.spenza.com/api/v1.1/notification-preferences"
payload = { "enabled": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://api.spenza.com/api/v1.1/notification-preferences', 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/notification-preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true
]),
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/notification-preferences"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.spenza.com/api/v1.1/notification-preferences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spenza.com/api/v1.1/notification-preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"preferences": [
{
"eventType": "simAssignment",
"enabled": false
},
{
"eventType": "planPurchase",
"enabled": false
},
{
"eventType": "activatePlan",
"enabled": false
},
{
"eventType": "lowBalance",
"enabled": false
},
{
"eventType": "planExpiry",
"enabled": false
},
{
"eventType": "purchasePlanError",
"enabled": false
},
{
"eventType": "qrCodeForEsimActivation",
"enabled": false
},
{
"eventType": "sendQRCodeEmail",
"enabled": false
},
{
"eventType": "sendCancellationEmail",
"enabled": false
},
{
"eventType": "sendOnboardingNotification",
"enabled": true
}
]
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "One or more fields failed validation.",
"details": {
"validationErrors": [
"enabled must be a boolean value"
]
}
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Something went wrong on our end. Please contact Spenza support if this continues."
}
}Authorizations
Bearer token obtained from POST /api/v1.1/auth/token.
Body
application/json
Response
The full preference matrix, post-update.
⌘I

