Share this page

# Assign project and role to user

Available in versions: 2020 SP3 and later

## Description

Assigns a specific project and role to a user.

## URL

Copy code

    /Admin/rest/v1/users/assignUser/{userID}

## Remarks

None

## HTTP Method

POST: Assigns a project and role to a specified user.

## Request

Headers:

Content-Type: application/xml

Accept: application/json, application/xml

Cookies:

ADM_LWSSO={AdmLwssoCookie};

Request Body:

An XML describing details of the user to be assigned.

The fields in the request are:

Element | Description
--- | ---
UserID | The ID of the user assigned to the project and role.
ProjectId | The project ID assigned to the user.
Role | The name of the role assigned to the user

Request Example
Copy code

    <LRE_Server>/Admin/rest/v1/users/assignUser/2
    Content-Type: application/xml
    Accept: application/xml
    Cookie: ADM_LWSSO={AdmLwssoCookie};

    <ProjectRole>
      <ProjectId>4</ProjectId>
      <Role>Viewer</Role>
    </ProjectRole>

## Response

Headers:

None

Cookies:

None

HTML Return Code:

One of the HTTP Return Codes.

Upon successful assignment, returns HTTP status 200 (OK).

## See Also

Update a user
Delete a user
Get user by ID
Get all users
Get list of users by query

Tips to improve your search results... LoadRunner Enterprise Administration REST API Reference LRE Admin REST API All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic(Undefined variable: _rscC_Basic_Variables.VersionLabel)