Skip to main content
PUT
/
api
/
adm
/
companyUsers
/
{id}
Update Company User
curl --request PUT \
  --url https://localhost:44371/api/adm/companyUsers/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Description

Updates company user details such as name, role (Admin/Member), phone number, or active status. Role changes affect permissions across all assigned projects immediately.

Input

  • Path Parameter: id (guid, required) — Unique identifier of the company user to update.
  • Body: model (CompanyUserUpdateCommandRequest, required) — Updated user information including:
    • id (guid, required) — User identifier (must match path parameter).
    • firstName (string, optional) — Updated first name.
    • lastName (string, optional) — Updated last name.
    • role (string, optional) — Updated role (Admin or Member).
    • phoneNumber (string, optional) — Updated phone number.
    • isActive (bool, optional) — Active status.

Output

Returns a CompanyUserUpdateCommandResponse indicating update success.

Example Request

PUT /api/admin/company-users/7c9e6679-7425-40de-944b-e07fc1f90ae7
Content-Type: application/json
Authorization: Bearer {token}

{
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "firstName": "John",
  "lastName": "Doe",
  "role": "Admin",
  "phoneNumber": "+1-555-0123",
  "isActive": true
}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Errors

  • 400 Bad Request — Cannot demote last admin (company must have at least one admin) or validation errors.
  • 404 Not Found — No user exists with the specified ID.

Notes

  • Role changes take effect immediately across all assigned projects.
  • Cannot demote the last company admin to Member.
  • Setting isActive to false prevents user login and access.
  • Email address cannot be changed via this endpoint.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
string<guid>
required

The unique identifier of the company user to update.

Body

application/json

The updated user information including name, role, and status.

Base structure for command requests that modify data. Represents the payload used to create a company user association. Represents the payload used to update a company user association.

userId
string<guid>

The unique identifier of the user being added to the company.

companyId
string<guid>

The identifier of the company the user is being added to.

roles
enum<string>

The company-level roles assigned to the user.

Available options:
None,
Admin,
User
id
string<guid>

The identifier of the company user record being updated.

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification. Represents the response returned after updating a company user.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null