Skip to main content

How to update Cost Alert on multiple SIMs at once?

You will need to send a PATCH request via the Onomondo API and run it through a list of SIMs.

Jakub Kubinski avatar
Written by Jakub Kubinski
Updated over a week ago

Environment

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.

  1. 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.

  2. Create an API key.

  3. Make a PATCH Update SIM request via the API.

    1. The header must contain your API key.

    2. The body must contain "cost_alert" object.

    3. 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 of 0.

  4. 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:

Did this answer your question?