Bulk user operation
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”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”UUID of the organization (tenant) the request acts in. It selects the tenant and grants nothing: the server checks membership or an open tenant switch. Not needed for global operations. A malformed value returns 400. API keys are fixed to their own organization; another organization returns 403. The x-organization-source header grants nothing.
Request Bodyrequired
Section titled “Request Bodyrequired”object
User IDs to apply the action to
Example
[ "uuid1", "uuid2"]Action to perform
Role ID for assign_role action
Organization ID for assign_role action
Reason for the operation
Responses
Section titled “Responses”Bulk operation completed
object
Total number of users processed
Number of successful operations
Number of failed operations
Failed user IDs with error messages
object
Per-user outcome (FM-862). Populated for reset_password, where an undelivered reset is NOT counted as successful and carries emailSent=false.
object
Target user ID
Whether the operation fully succeeded for this user
For reset_password: whether the reset email was actually delivered. False means the target was NOT counted as successful.
Failure reason when success is false
Examplegenerated
{ "processed": 1, "successful": 1, "failed": 1, "errors": { "additionalProperty": "example" }, "outcomes": [ { "userId": "example", "success": true, "emailSent": true, "error": "example" } ]}Invalid input data
Unauthorized
Forbidden - Super Admin required