Remove licenses from users using SmartSheet API

Options
AAsad
AAsad ✭✭
edited 04/03/23 in API & Developers

Hello all. I have a list of users who I want to transition to free collaborators. I want to do this using the API.

I first tried using the deactivate method but it doesn't reclaim the license. It just blocks access to Smartsheet.

I also tried using the update user method. The user sees that they are unlicensed. However, in the admin center, the user still has a license assigned to them.

Please help me out and let me know the best way to remove a user's license using Smartsheet API.

Best Answer

  • Julio S.
    Julio S. Moderator
    Answer ✓
    Options

    Hi @AAsad,

    Would you be able to send some captures showing an example of your API call to Update Users? You may need to refresh your access to the Admin Center and possibly download a User List for confirmation but I can confirm that this is the right method to update user roles in your organization using the API. I've also had the chance to test this and this was also visible in the Admin Center. As a reminder, the API token that you use to authenticate and send this API call will need to be that one of a System Admin (admin=true).

    If this still doesn't seem to work for you, please share some captures of the specific API call and the results in the Admin Center after this has been sent. You may hide any confidential information from your captures that you wouldn't like to make public.

    Cheers!

    Julio

Answers

  • Julio S.
    Julio S. Moderator
    Answer ✓
    Options

    Hi @AAsad,

    Would you be able to send some captures showing an example of your API call to Update Users? You may need to refresh your access to the Admin Center and possibly download a User List for confirmation but I can confirm that this is the right method to update user roles in your organization using the API. I've also had the chance to test this and this was also visible in the Admin Center. As a reminder, the API token that you use to authenticate and send this API call will need to be that one of a System Admin (admin=true).

    If this still doesn't seem to work for you, please share some captures of the specific API call and the results in the Admin Center after this has been sent. You may hide any confidential information from your captures that you wouldn't like to make public.

    Cheers!

    Julio

  • AAsad
    AAsad ✭✭
    Options

    Hi @Julio S.

    Thanks for your comment. I managed to resolve the issue myself after a few days. There seems to be a bug where if a user has licensedSheetCreator = False and groupAdmin = True, the UI shows the user in the unlicensed group but with license still assigned. This is because the group admin role requires the user to be licensed.

    Regardless, I have updated my script to include {"licensedSheetCreator": false, "groupAdmin": false}} for the PUT /user endpoint. It is working as expected now.

  • Julio S.
    Julio S. Moderator
    Options

    Hi @AAsad,

    Thanks for confirming this.

    In further testing, sending a request with the value combination you propose of "licensedSheetCreator": false and "groupAdmin": true should trigger a "A user must be a licensed sheet creator to be a group administrator." error message. If you continue to see this, I would recommend opening a ticket with our Support team via this form or accessing the Customer Support Portal since this should not be possible.

    Cheers!

    Julio