Skip to main content
All CollectionsGetting startedSIM management guides
How to update multiple SIMs at once
How to update multiple SIMs at once

You can update SIM properties by sending a PATCH request via the Onomondo API.

Jakub Kubinski avatar
Written by Jakub Kubinski
Updated over 3 weeks ago

Environment

Question

  • Is it possible to update multiple SIMs at the same time?

  • How to update multiple SIMs at once?

  • How to bulk update SIMs?

  • Can I update many SIMs in the app or do I have to use the API?

Answer

You can update multiple SIMs at once via the Onomondo API.

If you are updating 20 SIMs or more, run a PATCH Update SIM request that goes through each SIM ID you want to update.

  1. Create an API Key in the Onomondo app.

  2. Create a list of SIM IDs that need updating.

    • The list should be an array in the following format:

      ["000123456", "000123457", "000123458", ...]
  3. Prepare the PATCH Update SIM request, following the API documentation.

    • Specify cURL path:

      curl --location -g --request PATCH 'https://api.onomondo.com/sims/{{sim_id}}' \
    • Specify the following in the request header:

      --header 'Authorization: YOUR_API_KEY' \
      --header 'Content-Type: application/json' \
    • Include only the properties that need updating:

      --data '{ 
      "label": "test-device",
      "activated": true,
      "network_whitelist": "test-whitelist",
      "tags": "a5023f47-1db8-425e-b664-dc0b8921f644",
      "connector": "test-connector",
      "data_limit": {
      "total": 1000000,
      "type": "hourly",
      "alert_threshold": 800000
      },
      "technologies": {
      "sms": true,
      "2g_3g": false,
      "4g": true
      }
      }'
  4. Loop the PATCH request through the SIM list. Automate this by using either:

    • custom scripts, written in Python, JavaScript, or any language that supports HTTP requests.

    • a REST API client, fx. Postman.

Tip: Postman's Collection Runner feature allows you to upload a CSV file containing SIM IDs and run the PATCH request on a loop.



​Workaround:

If you are updating 20 SIMs or less, consider a PATCH Bulk SIM Update instead.

  1. Create an API Key in the Onomondo app.

  2. Prepare request body for PATCH Bulk SIM Update, following the API documentation, similarly to the above.

  3. Include SIM IDs in the request body.

  4. Send the PATCH request.

Note: PATCH Bulk SIM Update request is limited to 20 SIMs per call.

Cause

API controls can be useful to perform changes that impact large portions of your fleet. These operations are not fully supported in the app.

Did this answer your question?