Bulk user operation
POST
/api/v1/users/bulk
const url = 'http://localhost:3000/api/v1/users/bulk';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"userIds":["uuid1","uuid2"],"action":"enable","roleId":"example","organizationId":"example","reason":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/users/bulk \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "userIds": [ "uuid1", "uuid2" ], "action": "enable", "roleId": "example", "organizationId": "example", "reason": "example" }'Performs a bulk operation on multiple users. Supported actions: enable, disable, delete, reset_password, assign_role. Requires Super Admin privileges.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
userIds
required
User IDs to apply the action to
Array<string>
Example
[ "uuid1", "uuid2"] action
required
Action to perform
string
roleId
Role ID for assign_role action
string
organizationId
Organization ID for assign_role action
string
reason
Reason for the operation
string
Responses
Section titled “ Responses ”Bulk operation completed
Media type application/json
object
processed
required
Total number of users processed
number
successful
required
Number of successful operations
number
failed
required
Number of failed operations
number
errors
Failed user IDs with error messages
object
key
additional properties
string
Example generated
{ "processed": 1, "successful": 1, "failed": 1, "errors": { "additionalProperty": "example" }}Invalid input data
Unauthorized
Forbidden - Super Admin required