Skip to main content
POST
/
api
/
adm
/
companyUsers
Create Company User
curl --request POST \
  --url https://localhost:44371/api/adm/companyUsers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Description

Creates a new company user account establishing company-level access for an individual. This forms the basis for platform access and must be followed by project assignments for project-level permissions.

Input

  • Body: model (CompanyUserCreateCommandRequest, required) — User details including:
    • companyId (guid, required) — Parent company identifier.
    • email (string, required) — User email address (must be unique platform-wide).
    • firstName (string, required) — User first name.
    • lastName (string, required) — User last name.
    • role (string, required) — User role (Admin or Member).
    • phoneNumber (string, optional) — User phone number.

Output

Returns a CompanyUserCreateCommandResponse containing the ID of the newly created user.

Example Request

POST /api/admin/company-users
Content-Type: application/json
Authorization: Bearer {token}

{
  "companyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "email": "[email protected]",
  "firstName": "John",
  "lastName": "Doe",
  "role": "Member",
  "phoneNumber": "+1-555-0123"
}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "userId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}

Errors

  • 400 Bad Request — Email already exists, missing required fields, or validation errors.
  • 404 Not Found — Specified company ID does not exist.

Notes

  • Email addresses must be unique across the entire platform.
  • After creation, assign to projects using CompanyProjectUserController.
  • New users typically receive welcome emails with registration instructions.
  • Role can be Admin (full permissions) or Member (limited permissions).

Authorizations

Authorization
string
header
required

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

Body

application/json

The user details including company ID, email, name, role, and optional profile information.

Base structure for command requests that modify data. Represents the payload used to create 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

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. Create response containing the identifier of the newly created entity. Represents the response returned after creating 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

id
string<guid>

Unique identifier of the newly created entity.

Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"