Skip to content

Bulk user operation

POST
/api/v1/users/bulk
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.

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
Allowed values: enable disable delete reset_password assign_role
roleId

Role ID for assign_role action

string
organizationId

Organization ID for assign_role action

string
reason

Reason for the operation

string

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