POST/api/v1/change-user-role

Change a member's role

Replaces the role a member holds in one workspace, which changes the permissions and the spending policy that apply to them there.

AccessRequires a permission in the workspaceMANAGE_WORKSPACE

A member holds one role per workspace, and that role decides what they may do and how much they may move. This call replaces it. The member keeps their membership, their signing keys, and their history; only the role changes, and only in the workspace you name. Their role in any other workspace is untouched, because roles are workspace-scoped: see Roles and permissions.

uuid is the member's user id, which GET /api/v1/get-users-from-workspace returns as UUID. role_id is a role that already exists in the same workspace, listed by GET /api/v1/get-roles-and-perms-detailed as RoleUID.

warning:
Check the new role before you send this

The member gains every permission the new role holds and loses every permission it does not, along with the new role's spending limit and cycle. Read the target role with GET /api/v1/get-roles-and-perms-detailed first. The Owner role bypasses all permission checks and cannot be assigned manually.

Body parameters
workspace_uidnumberrequired
The workspace in which the member's role changes.
uuidnumberrequired
The member's user id, as returned in UUID by get-users-from-workspace.
role_idnumberrequired
The role to give the member. It must be a role that exists in this workspace.

#What happens next

The member's new role appears in the workspace member list on the next read of GET /api/v1/get-users-from-workspace, with the new spending limit and cycle beside it. The member's own view refreshes through GET /api/v1/get-user-info, and they can read the limit that now applies to them with GET /api/v1/get-my-limits.