Apply an action to many users
Users Admin
Apply an action to many users
POST
Apply an action to many users
π Admin only. Requires administrator privileges β the authenticated principal (API key, embed JWT, or any bearer token) must belong to a user with the admin role.
Apply one action to up to 100 users in a single request.
Request body:
actionβDEACTIVATE(revoke access and end the usersβ sessions),ACTIVATE(restore access to deactivated users), orDELETE(remove the users outright).userIdsβ the users to act on. Repeated ids are collapsed, so the response holds exactly one entry per distinct user requested.
200 whenever the request itself is well formed, and reports each userβs outcome separately:
succeededβ ids of the users the action was applied to.failedβ the users it was not applied to, each with anerrorcarrying thestatusandmessagethe single-user endpoint would have returned (404for an unknown id,403when a guard refuses the change).
failed array means the whole batch applied. Users are processed one at a time in the order given, each in its own transaction, so earlier changes are not rolled back when a later user fails β the response is the record of what was applied.
Every guard of the single-user endpoints still applies, per user:
- The callerβs own id fails rather than the request:
DEACTIVATEon self is403,DELETEon self is400. - A tenant must always keep at least one active, direct admin, so the action that would remove the last one fails with
403while the rest of the batch still applies.
Authorizations
Token authentication. Send Authorization: Bearer <YOUR_TOKEN>.
Body
application/json
BulkUserActionInput