Users

Set a user's role.

Changed on

Sets the role to user or admin. The last active administrator cannot be demoted. Requires an administrator as well as the scope. Recorded as a user_role_changed audit event naming the calling administrator as the principal and the calling API key in the details. Requires the users:write scope.

put/api/users/{username}/role

Request

  • Base URL
    / (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /api/users/{username}/role
  • Auth
    HTTP bearer

Path parameters

usernamestring required

Headers

Authorizationstring required

Request body

rolestring

user or admin.

Response

The role was set.

emailstring
activeboolean
createdstring date-time
deactivatedAtstring date-time
idstring

The user's id, which audit events and other records refer to the user by.

mfaEnabledboolean

Whether the user is enrolled in TOTP multi-factor authentication. The secret is never returned.

mfaLockedboolean

Whether the user's MFA is locked after repeated bad codes, until an administrator unlocks it.

passwordChangeRequiredboolean

Whether the user must change their password at next sign-in, because an administrator set it.

passwordSetboolean

Whether the user has a password. A user without one can only use API keys.

rolestring
usernamestring

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status