Need to audit our OAuth clients and their assigned scopes programmatically. I see the /api/v2/integrations/oauth/clients endpoint returns the client list, but the response only gives IDs and names, no scope details.
Is there a separate endpoint to fetch scopes for each client? Or do I need to loop through every client ID and hit a specific path? The docs are sparse on this. Running a Python script to check for overprivileged clients.
You definitely don’t need to loop through individual client IDs. The PureCloudPlatformClientV2 SDK handles this cleanly. Just call get_integration_oauth_clients with the expand=['scopes'] parameter. It pulls everything in one shot.
from platform_sdk_python import PureCloudPlatformClientV2
client = PureCloudPlatformClientV2('your_instance', 'your_token')
result = client.get_integration_oauth_clients(expand=['scopes'])
Check the scopes array in the response for each client. Saves a ton of API calls.