Browse the help center

Give an account a role, or switch it off

Changes which role an account holds and whether it is switched on, and nothing else: the fields the call does not name are left exactly as they are.

Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/system-users/{userId}/access.do

Changes which role an account holds and whether it is switched on, and nothing else: the fields the call does not name are left exactly as they are. The role has to be one the caller may hand out (Create on it, as on the console's user form) and so does the account's current role, otherwise the call is refused and nothing changes -- which is what stops an account being taken over by re-saving it under a role the caller may hand out. The read's 'changeable' and 'assignableRoles' answer both questions before the call. Switching an account on or off sends the same activation or deactivation mail the console sends. A profile field other than these two is changed with user/update.do. No credential is part of this: a password cannot be set, reset or changed here, and no API key is issued. Requires the User Management console permission.

Path Params

userId integer required

Numeric id of the user, as system-users/search.do reports it

42

Form Params

role string

The role to give the account: its id, or its name as roles.do spells it

4

active boolean

Whether the account is switched on; off, it cannot sign in

true

Responses

200

{success, changed:[...], and the account as the read answers it}

400

'role' names no role, or neither field was sent

401

Authentication error

403

The caller does not hold User Management, or may not hand out that role or change that account

404

No user with that id

Please disable Adblock
Are you using adblock? Disable it and reload the page to proceed to the destination page.

A registration has already been submitted from this page. Please try again in 10 minutes.