Set a member's roles
Replaces every role the user holds in the store with role_ids and
returns the roles now held. Also adds a user to the store. The roles
together may not grant permissions the caller does not hold. The
store owner's roles cannot be changed; transfer ownership first.
Authorization
bearer_auth Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.
In: header
Path Parameters
Store id
uuidThe member's user id
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/roles" \ -H "Content-Type: application/json" \ -d '{ "role_ids": [ "3805f8ab-a16f-4b9c-912c-4f3e3ae2a6f1" ] }'[
{
"color": "string",
"created_at": "2019-08-24T14:15:22Z",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_system": true,
"name": "string",
"permission_codes": [
"string"
],
"position": 0,
"store_id": "7fe87115-950c-4ae8-bd7e-970406bc9ac0",
"updated_at": "2019-08-24T14:15:22Z"
}
]{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}