Skip to main content

Create Role Assignment

Request

Create a new RoleAssignment, thereby granting the principal the permissions defined by the given Role.

The auth token's access policy must allow action:use/createRoleAssignment.

Security
bearerAuth
Bodyapplication/jsonrequired
principalstring(Principal)^principal:([0-9a-zA-Z](?![^:]*-$)(?![^:]*--)...required

The principal to be assigned to a Role.

Example:"principal:abc-123:idp:example-user"
roleIdstring(RoleId)^role:[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$required

Id of the Role to be assigned to the principal.

Example:"role:550e8400-e29b-41d4-a716-446655440000"
assignmentScopeobjectrequired

The scope this assignment applies to, usually a specific Project or Organization.

Payload
{ "principal": "principal:abc-123:idp:example-user", "roleId": "role:550e8400-e29b-41d4-a716-446655440000", "assignmentScope": { "id": "07218c48-343d-43e2-9831-a2080445cd22", "type": "PROJECT", "parent": { … } } }

Responses

Success

Bodyapplication/json
roleAssignmentIdstring(RoleAssignmentId)^roleassignment:[0-9a-f]{8}(-[0-9a-f]{4}){3}-...required

Immutable UUID of this RoleAssignment

Example:"roleassignment:550e8400-e29b-41d4-a716-446655440000"
projectIdstring(ProjectId)^project:[0-9a-zA-Z](?![^:]*-$)(?![^:]*--)[0-...required

Id of the project that owns this assignment

Example:"project:abc-123"
principalPrincipal (string) or Group (string)required
Any of:

Globally unique string identifier for a principal formatted like "principal:...".

string(Principal)
roleIdstring(RoleId)^role:[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$required

Id of the Role assigned to the principal

Example:"role:550e8400-e29b-41d4-a716-446655440000"
roleNamestringrequired

Name of the Role assigned to the principal

Example:"Network Admin"
assignmentScopeobjectrequired

The scope this assignment applies to, usually a specific Project or Organization.

Response
{ "roleAssignmentId": "roleassignment:550e8400-e29b-41d4-a716-446655440000", "projectId": "project:abc-123", "principal": "principal:abc-123:idp:example-user", "roleId": "role:550e8400-e29b-41d4-a716-446655440000", "roleName": "Network Admin", "assignmentScope": { "id": "07218c48-343d-43e2-9831-a2080445cd22", "type": "PROJECT", "name": "My Project", "parent": { … } } }
Was this page helpful?