Step 3: Create the user role assignment

POST {{apiPath}}/environments/{{envID}}/users/{{userID}}/roleAssignments

Create a new user role assignment using the {{apiPath}}/environments/{{envID}}/users/{{userID}}/roleAssignments request.

In the request URL, specify the {{userID}} that you copied from step 1.

In the body of the request, specify the {{roleID}} from step 2.

The body also includes the scope attribute. This specifies the resource type and ID to designate the scope of the role assignment. In the sample, scope.type is ENVIRONMENT. The specific environment to which the role assignment applies is specified in the scope.id value. For more information, see the User role assignments data model.

Request Body

{"role"=>{"id"=>"{{envAdmRoleID}}"}, "scope"=>{"id"=>"{{envID}}", "type"=>"ENVIRONMENT"}}

HEADERS

KeyDatatypeRequiredDescription
Authorizationstring
Content-Typestring