Skip to main content
Question

API call - list users by status

  • May 22, 2025
  • 2 replies
  • 10 views

Forum|alt.badge.img

Hi, There is an option to list users by status via API? ("Inactive" in my case)

*I'm using Python

 

Thanks! 🙂

2 replies

Forum|alt.badge.img

Hi , As you cannot fetch only inactive users from Box, you need to fetch all users and then filter the results something like:

users = client.users(user_type='managed')
for user in users:
  if user.status == 'inactive':
    print('User Login: {1}'.format(user.login))


Forum|alt.badge.img
So the request should be like this?
Thanks!
 
from boxsdk import JWTAuth
import requests
import json
from boxsdk import Client
 
config = JWTAuth.from_settings_file("<file_path>\\config.json")
client = Client(config)
 
users = client.users(user_type='managed')
for user in users:
  if user.status == 'inactive':
    print('User Login: {1}'.format(user.login))