Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Rest API for bulk update of users in MAS (mongoDB db)

    Posted Thu June 26, 2025 01:20 PM

    Hello,

    We need to bulk update the user records in MAS (stored in the mongoDB db). Our application provider does not want to use SQL commands to perform these bulk updates and considering the volume of data, it would not only take a good amount time to manually update each active user record but also it can be error prone.

    Someone told me that IBM provides "Rest API" for (possibly bulk) adding, modifying the user records in MAS (stored in the MongoDB). Can someone provide any documentation, links, examples etc.

    This would be very useful to us.

    Thanks



    ------------------------------
    Pankaj Bhide
    ------------------------------


  • 2.  RE: Rest API for bulk update of users in MAS (mongoDB db)

    Posted Thu June 26, 2025 02:57 PM

    Hi @Pankaj Bhide

    Could you please look at this Maximo Application Suite Admin APIs 9.0.x REST APIs for performing Suite administration operations documentation: 

    I think you will find all of the information that you need there.



    ------------------------------
    Bartosz Marchewka
    IBM Maximo Consultant
    AFRY
    ------------------------------



  • 3.  RE: Rest API for bulk update of users in MAS (mongoDB db)

    Posted Fri June 27, 2025 10:24 AM

    Hi Pankaj,

    We actually used a bulk user update approach even for MAS 8.10. As we executed it manually, we used a saved session cookie header and I'm going to share this approach below. If you're looking for automation, then proper authentication is a more robust approach. However to be able to use MAS Admin APIs, it's quite tricky as you need to register an API key token in MAS Core first and then obtain a JWT token using the API call as documented here: https://developer.ibm.com/apis/catalog/maximo--maximo-application-suite-admin-apis-9-0-x/api/API--maximo--api-key-management#get289287395

    We used the cookie as I mentioned above, it can be extracted via the browser dev tools from any active session. This approach is easier as you don't have to obtain the JWT token.

    See an example script to bulk update users by granting them access to Manage application:

    #!/bin/bash
    
    MAS_INSTANCE_ID=mas_instance_id
    MAS_WORKSPACE_ID=mas_workspace_id
    MAS_DOMAIN=mas_domain
    
    USERIDS=(userid1 userid2 userid3)
    BASE_URL=api.$MAS_INSTANCE_ID.apps.$MAS_DOMAIN
    COOKIE="..."
    
    for userid in $USERIDS; do
      curl -X PUT "https://$BASE_URL/workspaces/$MAS_WORKSPACE_ID/applications/manage/users/$userid" \
        -H "Content-Type: application/json" \
        -H "Cookie: $COOKIE" \
        -d '{"role":"MANAGEUSER"}'
    done



    ------------------------------
    Ivan Lagunov
    Manager Technology
    ZNAPZ B.V.
    ------------------------------



  • 4.  RE: Rest API for bulk update of users in MAS (mongoDB db)

    Posted Mon June 30, 2025 10:36 AM

    I've dealt with something similar recently. IBM MAS does provide REST APIs that can be used to manage user records, including updates. While there isn't a direct "bulk update" endpoint, you can script multiple update calls using the user management API.

    Start by checking out the official IBM MAS REST API documentation here:
    [https://www.ibm.com/docs/en/mas-cd](https://www.ibm.com/docs/en/mas-cd)

    Once there, search for the **User Management API** section. It outlines endpoints for creating, updating, and managing users.

    For bulk updates, you'd typically:

    * Write a script (Python, Node.js, etc.) to read your user data
    * Use the `PATCH` or `PUT` endpoints in a loop to update each user
    * Handle errors and retries to avoid data issues

    Since your data is in MongoDB, make sure any changes done via API align with the expected schema in MAS to avoid breaking things.

    If you're working in a secure or production environment, check with your admin to ensure the API access is enabled and you have the right tokens/permissions to make these calls.

    Let me know if you need help putting together an example script.



    ------------------------------
    Frank Reebig
    ------------------------------