Environment
Onomondo app:
Individual SIM page
Cost Alert
Onomondo API: PATCH Update SIM
Question
How to update Cost Alert on multiple SIMs at once?
Is there a way to do a bulk update for the Cost Alert across all SIMs?
Answer
You can update the Cost Alert on multiple SIMs using the Onomondo API.
Export a list of all of your SIM IDs as a CSV file, where header is "
sim_id
". This can be achieved by exporting all of your SIMs via this GET Retrieve All SIMs request.Create an API key.
Make a PATCH Update SIM request via the API.
The header must contain your API key.
The body must contain
"cost_alert"
object.There are two required properties in the object:
period
- pick from one of these values"daily"
or"monthly"
.threshold
- a number in EUR with a minimum of0
.
Run the request on a loop through the CSV containing the SIM list.
Example request:
curl --location -g --request PATCH 'https://api.onomondo.com/sims/{{sim_id}}' \
--header 'Authorization: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"sims": [
"cost_alert": {
"period": "daily",
"threshold": 1
}
]
}
You can run this PATCH request for a single SIM first to see how it works.
New to the API? See how to get started here: