Accounts-accountId-users-userName-roles:PUT

From Hostway API Documentation
Jump to: navigation, search

PUT /accounts/{accountId}/users/{userName}/roles

Modify the roles of a user.

Contents


Request

PUT /accounts/{accountId}/users/{userName}/roles

Request Parameters

accountId
The ID of the account
userName
The username of the user

URI Parameters

None

Request Headers

Authorization - HTTP Authorization header [1]
The Authentication credentials of the client application.

Request Body

List of new roles to be set to the requested user

[
  "role1",
  "role2"
]
 

Allowed Roles

Can be retrieved with GET /roles call.

Response

Status Code

204 No Content
The user's roles were successfully updated
400 Bad Request
The request body was malformed, or the specified roles are not allowed, or the account owner was attempting to demote himself/herself which is not allowed. (in this case, the response body will contain hints for what went wrong)
401 Unauthorized
Authentication failed
403 Forbidden
Authentication succeeded, but the logged-in user is not allowed to update the roles of this user. The only users allowed to update the roles of this user are this very user, account owner(s) of this account, and sales/support agents. An account owner is any account user with the "sitecontrol_account_owner" role. An account owner may not remove their own "sitecontrol_account_owner" role, though they may do this to other account owners.
404 Not Found
Either the account or user does not exist

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox