POST api/superadmin/users/{userId}/assign-role

Request Information

URI Parameters

NameDescriptionTypeAdditional information
userId

string

Required

Body Parameters

RoleAssignmentRequest
NameDescriptionTypeAdditional information
RoleName

string

Required

Notes

string

None.

Request Formats

application/json, text/json

Sample:
{
  "RoleName": "sample string 1",
  "Notes": "sample string 2"
}

application/xml, text/xml

Sample:
<RoleAssignmentRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/UCareAPI.Models">
  <Notes>sample string 2</Notes>
  <RoleName>sample string 1</RoleName>
</RoleAssignmentRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'RoleAssignmentRequest'.

Response Information

Resource Description

RoleAssignmentResult
NameDescriptionTypeAdditional information
Success

boolean

None.

Message

string

None.

UserId

string

None.

RoleName

string

None.

AssignedDate

date

None.

Response Formats

application/json, text/json

Sample:
{
  "Success": true,
  "Message": "sample string 2",
  "UserId": "sample string 3",
  "RoleName": "sample string 4",
  "AssignedDate": "2026-03-26T03:50:44.4759297+02:00"
}

application/xml, text/xml

Sample:
<RoleAssignmentResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/UCareAPI.Models">
  <AssignedDate>2026-03-26T03:50:44.4759297+02:00</AssignedDate>
  <Message>sample string 2</Message>
  <RoleName>sample string 4</RoleName>
  <Success>true</Success>
  <UserId>sample string 3</UserId>
</RoleAssignmentResult>