Skip to main content
PUT
/
tenant
/
{tenantId}
/
admin
/
user
PutTenantUser
curl --request PUT \
  --url https://api.example.com/tenant/{tenantId}/admin/user \
  --header 'Content-Type: application/json' \
  --data '
{
  "tenantId": 1024,
  "email": "[email protected]",
  "actorUserId": "9f060a6b-1571-4a2f-8cfb-3fc6bf5a4e51",
  "principalOid": "d3b07384-d9a1-4655-a08e-df5f4f6d7d19",
  "firstName": "Casey",
  "lastName": "Taylor",
  "id": 256,
  "isEnabled": true
}
'
{
  "isSuccess": true,
  "isFailure": false,
  "error": null,
  "value": {
    "id": 42,
    "name": "Example"
  }
}

Description

This endpoint updates an existing tenant user’s profile information and enabled status. Changes are applied atomically.

Input

  • tenantId (path, required): Identifier of the tenant that owns the user
  • request (body, required): Update payload containing user properties
    • id: Identifier of the tenant user to update
    • email: Updated email address
    • firstName: Updated first name
    • lastName: Updated last name
    • principalOid: Updated principal object identifier
    • isEnabled: Updated enabled status
  • cancellationToken (optional): Token to cancel the asynchronous operation

Output

Returns a Result<TenantUserViewModel> containing the updated user details with roles.

Examples

Request:
PUT /api/tenant/1024/users
Content-Type: application/json

{
  "id": 256,
  "tenantId": 1024,
  "email": "[email protected]",
  "actorUserId": "9f060a6b-1571-4a2f-8cfb-3fc6bf5a4e51",
  "principalOid": "d3b07384-d9a1-4655-a08e-df5f4f6d7d19",
  "firstName": "Casey",
  "lastName": "Taylor-Updated",
  "isEnabled": true
}
Response (200 OK):
{
  "data": {
    "id": 256,
    "userId": 4242,
    "tenantId": 1024,
    "email": "[email protected]",
    "firstName": "Casey",
    "lastName": "Taylor-Updated",
    "isEnabled": true,
    "roles": []
  },
  "isSuccess": true
}

Errors

  • 400 Bad Request: Invalid payload or validation failure
  • 401 Unauthorized: Authentication credentials are missing or invalid
  • 403 Forbidden: User lacks permission to update tenant users
  • 404 Not Found: Tenant user does not exist
  • 500 Internal Server Error: Unexpected server error occurred during update

Notes

  • Email address must be unique within the tenant
  • Disabling a user prevents them from accessing tenant resources
  • Role assignments are not modified by this operation

Path Parameters

tenantId
integer<int64>
required

Identifier of the tenant that owns the user.

Body

application/json

Payload describing the updates to apply to the tenant user.

Request to update an existing tenant user's profile and status.

tenantId
integer<int64>

Identifier of the tenant for which the user should be created.

Example:

1024

email
string

Email address that uniquely identifies the user.

actorUserId
string

Identifier of the actor performing the creation.

Example:

"9f060a6b-1571-4a2f-8cfb-3fc6bf5a4e51"

principalOid
string

Azure AD object identifier for the user principal.

Example:

"d3b07384-d9a1-4655-a08e-df5f4f6d7d19"

firstName
string

First name associated with the user.

Example:

"Casey"

lastName
string

Last name associated with the user.

Example:

"Taylor"

id
integer<int64>

Identifier of the tenant user to update.

Example:

256

isEnabled
boolean

True to keep the user enabled, false to disable access.

Example:

true

Response

Tenant user updated successfully.

Wrapper for API operation results containing success status, error information, and return value.

isSuccess
boolean

True if the operation completed successfully, false otherwise.

Example:

true

isFailure
boolean

True if the operation failed, false otherwise.

Example:

false

error
object

Error information returned when the operation fails.

Example:
{
"code": "ValidationError",
"message": "The request parameters failed validation.",
"info": [
"The Name field is required.",
"The Id field must be greater than 0."
]
}
value
object

The result value returned when the operation is successful.

Example:
{
"id": 256,
"userId": 4242,
"tenantId": 1024,
"principalOid": "d3b07384-d9a1-4655-a08e-df5f4f6d7d19",
"firstName": "Casey",
"lastName": "Taylor",
"email": "[email protected]",
"isEnabled": true,
"roles": [
{
"id": 12,
"name": "TenantAdministrator",
"description": "Grants full tenant administration capabilities."
}
]
}