POST api/users/{id}/role?reassign={reassign}&autoAddRole={autoAddRole}&caseSensitiveRole={caseSensitiveRole}

Assigns a new role to a user or schedules a role change, with optional automatic role creation.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

The ID of the user to whom the role is being assigned.

integer

Required

reassign

Specifies how reassignment should be handled (e.g., \"role\", \"user\").

string

Default value is role

autoAddRole

If true, creates the role if it does not exist.

boolean

Default value is True

caseSensitiveRole

If true, role name matching is case-sensitive.

boolean

Default value is False

Body Parameters

The role details to assign, including name, FTE, days available, cost, and start date.

RoleDTO
NameDescriptionTypeAdditional information
name

Role Name

string

None.

FTE

Full time equivalent

string

None.

actualCost

Actual Cost of this user (e.g. Salary)

string

None.

startDate

Date user will start at this role, only relevant for a role change.

date

None.

daysAvailable

Days User will be working at this role, format as mon|tue|wed|thu|fri|sat|sun with only relevant days supplied

string

None.

utilisation

Target Billable ( number between 0-100 )

string

None.

Request Formats

application/json, text/json, application/scim+json

Sample:
{
  "name": "sample string 1",
  "FTE": "sample string 2",
  "actualCost": "sample string 3",
  "startDate": "2025-11-21T03:19:45.5394606+00:00",
  "daysAvailable": "sample string 5",
  "utilisation": "sample string 6"
}

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 'RoleDTO'.

Response Information

Resource Description

On success: HTTP 200 OK if the role is assigned or scheduled successfully. On failure: HTTP 400 Bad Request with an appropriate error message.

IHttpActionResult

None.

Response Formats

application/json, text/json, application/scim+json

Sample:

Sample not available.