Bulk User Deletion Without Relying on Management API RPS

Overview

This article will explain a way to delete all the users for a connection without using the Management APIs, which are rate-limited to limited Rates per Second (RPS), and the associated risks.

Applies To

  • Connections
  • Bulk Delete Users

Solution

To delete all the users from a specific connection, delete the connection and recreate it afterward. This way, there is no risk of exceeding the Management’s API’s RPS to delete the users individually.

Please consider the following factors:

  • Deleting the connection will delete all the users under it, but keep in mind that it is not instant.
  • The connection is deleted instantly — as soon as the 204 is received from the DELETE /api/v2/connections call, the connection is gone.
  • The users are deleted asynchronously, which may take a while to complete. The time depends on many factors, such as the number of users in the connection and the load of the cluster.
  • The connection cannot be recreated with the same name before all the users are deleted. This could be critical when doing this in a production tenant.

To delete a connection, follow these steps:

  1. Get the connection ID
  2. Pass the connection ID to the Delete a connection endpoint to delete the connection, and users
  3. Create a new connection with the old configuration and enable it for the desired apps

Please note: Once a connection and its users are deleted, they cannot be recovered!