> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create User

> Create a new User record.

A **User** represents an administrator or staff member who can sign in to the Nexudus admin panel. Users are assigned roles that control their permissions and can be associated with one or more business locations.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`User-Create`** role.
</Note>

## Enums

<Accordion title="eLanguage — Language values">
  | Value | Name      |
  | ----- | --------- |
  | 3     | EnglishUK |
  | 1     | EnglishUS |
  | 2     | Spanish   |
</Accordion>

## Request Body

### Required Fields

<ParamField body="FullName" type="string" required>
  The full name value for this user.
</ParamField>

<ParamField body="Email" type="string" required>
  The email value for this user.
</ParamField>

<ParamField body="Language" type="integer" required>
  The language value for this user.
</ParamField>

<ParamField body="PasswordSalt" type="string" required>
  The password salt value for this user.
</ParamField>

<ParamField body="LastHelpVisited" type="integer" required>
  The last help visited value for this user.
</ParamField>

<ParamField body="InvalidLoginAttempts" type="integer" required>
  The invalid login attempts value for this user.
</ParamField>

### Optional Fields

<ParamField body="AccessToken" type="string">
  The access token value for this user.
</ParamField>

<ParamField body="PreferredLanguageId" type="integer">
  ID of the preferred language linked to this record.
</ParamField>

<ParamField body="NewPassword" type="string">
  The new password value for this user.
</ParamField>

<ParamField body="Password" type="string">
  The password value for this user.
</ParamField>

<ParamField body="NewAvatarUrl" type="string">
  URL of a new file to upload as the avatar.
</ParamField>

<ParamField body="ClearAvatarFile" type="boolean">
  Set to true to remove the current avatar file.
</ParamField>

<ParamField body="ApplicationId" type="integer">
  ID of the application linked to this record.
</ParamField>

<ParamField body="Active" type="boolean">
  Whether this user is currently active.
</ParamField>

<ParamField body="IsAdmin" type="boolean">
  Whether is admin is enabled.
</ParamField>

<ParamField body="APIAccess" type="boolean">
  Whether api access is enabled.
</ParamField>

<ParamField body="Validated" type="boolean">
  Whether validated is enabled.
</ParamField>

<ParamField body="MustResetPassword" type="boolean">
  Whether must reset password is enabled.
</ParamField>

<ParamField body="LastAccess" type="string">
  Date/time value for last access.
</ParamField>

<ParamField body="Devices" type="string">
  The devices value for this user.
</ParamField>

<ParamField body="OnNewEmail" type="boolean">
  Whether on new email is enabled.
</ParamField>

<ParamField body="OnHelpDeskMsg" type="boolean">
  Whether on help desk msg is enabled.
</ParamField>

<ParamField body="OnNewWallPost" type="boolean">
  Whether on new wall post is enabled.
</ParamField>

<ParamField body="OnNewMember" type="boolean">
  Whether on new member is enabled.
</ParamField>

<ParamField body="OnProfileChanges" type="boolean">
  Whether on profile changes is enabled.
</ParamField>

<ParamField body="OnNewBlogComment" type="boolean">
  Whether on new blog comment is enabled.
</ParamField>

<ParamField body="OnNewEventComment" type="boolean">
  Whether on new event comment is enabled.
</ParamField>

<ParamField body="OnTariffChange" type="boolean">
  Whether on tariff change is enabled.
</ParamField>

<ParamField body="OnBookingChange" type="boolean">
  Whether on booking change is enabled.
</ParamField>

<ParamField body="OnTentativeBookingChange" type="boolean">
  Whether on tentative booking change is enabled.
</ParamField>

<ParamField body="OnPurchases" type="boolean">
  Whether on purchases is enabled.
</ParamField>

<ParamField body="OnVisitorRegistration" type="boolean">
  Whether on visitor registration is enabled.
</ParamField>

<ParamField body="OnPlaformInvoices" type="boolean">
  Whether on plaform invoices is enabled.
</ParamField>

<ParamField body="ReceiveCommunityDigest" type="boolean">
  Whether receive community digest is enabled.
</ParamField>

<ParamField body="ReceiveEveryMessage" type="boolean">
  Whether receive every message is enabled.
</ParamField>

<ParamField body="TwoFactorSecret" type="string">
  The two factor secret value for this user.
</ParamField>

<ParamField body="EmailCallBackGuid" type="string">
  Unique identifier (GUID) for the email call back.
</ParamField>

<ParamField body="Businesses" type="integer[]">
  List of businesses linked to this record.
</ParamField>

<ParamField body="UserRoles" type="integer[]">
  List of user roles linked to this record.
</ParamField>

<ParamField body="ChatRooms" type="integer[]">
  List of chat rooms linked to this record.
</ParamField>

<ParamField body="LastReceivedCommunityThreadDate" type="string">
  Date/time value for last received community thread date.
</ParamField>

<ParamField body="LastReceivedCommunityMessageDate" type="string">
  Date/time value for last received community message date.
</ParamField>

<ParamField body="NextCommunityDigest" type="string">
  Date/time value for next community digest.
</ParamField>

<ParamField body="SupportTeamUserEmail" type="string">
  The support team user email value for this user.
</ParamField>

<ParamField body="LastLoginAttempt" type="string">
  Date/time value for last login attempt.
</ParamField>

<ParamField body="OnAccessControlErrors" type="boolean">
  Whether on access control errors is enabled.
</ParamField>

<ParamField body="NextHelpDeskMessageReminder" type="string">
  Date/time value for next help desk message reminder.
</ParamField>

<ParamField body="OnMemberRemovedFromTeam" type="boolean">
  Whether on member removed from team is enabled.
</ParamField>

<ParamField body="OnVirtualOfficeTariffChange" type="boolean">
  Whether on virtual office tariff change is enabled.
</ParamField>

<ParamField body="OnVirtualOfficeDeliveryPreferenceUpdate" type="boolean">
  Whether on virtual office delivery preference update is enabled.
</ParamField>

<ParamField body="OnIdentityCheckUpdate" type="boolean">
  Whether on identity check update is enabled.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/sys/users" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "FullName": "",
      "Email": "",
      "Language": 0,
      "PasswordSalt": "",
      "LastHelpVisited": 0,
      "InvalidLoginAttempts": 0
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/sys/users',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        FullName: '',
        Email: '',
        Language: 0,
        PasswordSalt: '',
        LastHelpVisited: 0,
        InvalidLoginAttempts: 0
      })
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://spaces.nexudus.com/api/sys/users',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'FullName': '',
          'Email': '',
          'Language': 0,
          'PasswordSalt': '',
          'LastHelpVisited': 0,
          'InvalidLoginAttempts': 0
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the creation.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the newly created record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the user was created successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "User was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "FullName: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "FullName"
    }
  ],
  "WasSuccessful": false
}
```
