Assign role
hub_assign_roleMove a team member onto a different role — this is how someone gains or loses access. Answers 'give Maria access to the reports', 'make him a cashier again', 'take away her permissions'. PERMISSIONS ARE POWER. Confirm with the merchant first, naming the person and the role out loud ("give Maria the Manager role — yes?"), and never act on a role change you inferred rather than were asked for. The change is live on the next request: rights are re-read from the role every time, so no one logs out and no agent key stops working — including yours, if the change reaches your own account. It swaps their WHOLE permission set for that role’s, so read get_roles first and check the new role really carries what the merchant asked for and nothing dangerous besides — if no existing role fits, say so rather than picking the closest one. You may also point the merchant’s own account at another role, including the account this agent key belongs to, which would change your own permissions from the next call onward: never do that unless the merchant asked for it in those words. To change what a role itself allows, without moving anyone, use update_role.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roleId | Yes | Role id from get_roles — not a role name | |
| userId | Yes | User id from get_team — not a name |