Using API to enable or disable users | XM Community
Skip to main content
Question

Using API to enable or disable users

  • 24 July 2024
  • 1 reply
  • 19 views

Has anyone tried enabling or disabling users using the API? We need to automate the process of disabling users who haven't been active for a year and enabling them again if they rejoin the organization. Additionally, we'd like to integrate this functionality with our service portal to handle requests automatically.

 

 

1 reply

Userlevel 5
Badge +17

Hi @subbadaju. It depends a little bit on which information you have about the users and which integration capabilities you have. 

For the deactivation of inactive users, I would set up some daily/weekly execution: 

  1. Read all users of your brands with the list users API.
  2. Based on the user IDs you receive from step 1, execute the get user API request for each of them. This provides you a property called lastLoginDate based on which you can identify users that are inactive for at least 1 year. Ignore those whose accountStatus property is not active as they have already been deactivated.
  3. Use the update user API to update the users identified in step 2. Set the status property to disabled. If you just want to temporarily disable them 

If you want to reactive a user, you can use the update user API and set the status property to active. If you do not have the Qualtrics internal user ID at this point, you can start the process again with the list users API and identify the relavant user e.g. based on the email property.

The manage user guide is pretty the same as the single API documentations, but provides some more details such as available status values.

Best
Christian

Leave a Reply