Access Control - Assign Role
Assign a role to principal.
POST https://prod.core.sphere.azure.net/v2/tenants/{tenantId}/users/{userId}/role/{roleName}/assign
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
role
|
path | True |
string |
The name of the role to assign to userId. Some supported role names include 'Administrator' and 'Contributor'. For a list of all supported role names, use /v2/tenants/{tenantId}/users/{userId}/role API. |
tenant
|
path | True |
string uuid |
The tenant ID in which to assign the role. |
user
|
path | True |
string |
Principal ID or email address to assign role to. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Success. |
Examples
Assign the Reader role
Sample request
POST https://prod.core.sphere.azure.net/v2/tenants/768c2cd6-1bf0-4521-9f53-084a331d81cb/users/avery@contoso.com/role/Reader/assign