{
"data": {
"principal": {
"type": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"roleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"roleScope": "organization",
"tenantId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>"
}
}{
"errors": [
{
"code": "TenantIdRequired",
"message": "tenantId is required for this role"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "RoleNotFound",
"message": "role not found"
}
]
}{
"errors": [
{
"code": "RoleHasAssignments",
"message": "role has active assignments; revoke them first"
}
]
}Assign a role
Grants a built-in or custom role to a user or a user group. For the built-in Tenant admin and Tenant read-only roles, tenantId names the one tenant the grant applies to and is required; for every other role it is not accepted, because a custom role is already bound to its tenant. A tenant that is not in your organization answers 404 TenantNotFound, and a user that does not exist answers 404 UserNotFound. Granting the same role to the same principal for the same tenant twice answers 409 AssignmentAlreadyExists. Users your identity provider manages over SCIM can be granted roles directly, like any other user.
Requires an organization API key with read and write access.
{
"data": {
"principal": {
"type": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"roleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"roleScope": "organization",
"tenantId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>"
}
}{
"errors": [
{
"code": "TenantIdRequired",
"message": "tenantId is required for this role"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "RoleNotFound",
"message": "role not found"
}
]
}{
"errors": [
{
"code": "RoleHasAssignments",
"message": "role has active assignments; revoke them first"
}
]
}Authorizations
Plerion organization API key (plerion_oak_…), created by an organization admin in the Plerion app.
Body
Response
The created assignment.
Show child attributes
Show child attributes
Was this page helpful?