> ## 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>
  Required full name shown for this staff account..
</ParamField>

<ParamField body="Email" type="string" required>
  Required valid email address used to identify and sign in to this staff account..
</ParamField>

<ParamField body="Language" type="integer" required>
  Legacy language setting; use PreferredLanguage instead..
</ParamField>

<ParamField body="PasswordSalt" type="string" required>
  Password-hashing salt generated by the platform; never expose or set it..
</ParamField>

<ParamField body="LastHelpVisited" type="integer" required>
  Internal identifier of the last help page viewed by this user..
</ParamField>

<ParamField body="InvalidLoginAttempts" type="integer" required>
  Internal count of failed login attempts; the platform resets it after a successful password change and applies its lockout threshold..
</ParamField>

### Optional Fields

<ParamField body="AccessToken" type="string">
  Authentication token generated by the platform; never expose or set it..
</ParamField>

<ParamField body="PreferredLanguageId" type="integer">
  ID of the optional location language used for this account's preferred interface and content language..
</ParamField>

<ParamField body="NewPassword" type="string">
  New sign-in password; do not expose or set passwords through the Admin Agent..
</ParamField>

<ParamField body="Password" type="string">
  Stored password hash; never expose or set it directly..
</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 optional marketplace application whose integration uses this account..
</ParamField>

<ParamField body="Active" type="boolean">
  Whether this staff account is active; notification recipient queries generally require an active account..
</ParamField>

<ParamField body="IsAdmin" type="boolean">
  Whether this account has administrator access in addition to any permissions granted through UserRoles..
</ParamField>

<ParamField body="APIAccess" type="boolean">
  Whether this account may authenticate for API access..
</ParamField>

<ParamField body="Validated" type="boolean">
  Whether the platform marks this account as validated..
</ParamField>

<ParamField body="MustResetPassword" type="boolean">
  Whether the user must reset their sign-in password; the platform sets this when it generates a password..
</ParamField>

<ParamField body="LastAccess" type="string">
  Read-only UTC timestamp of the latest account access, rounded down to the nearest 15 minutes..
</ParamField>

<ParamField body="Devices" type="string">
  Registered device identifiers used for device-based authentication; manage them outside the Admin Agent..
</ParamField>

<ParamField body="OnNewEmail" type="boolean">
  Whether to notify this active user about new internal messages for their locations..
</ParamField>

<ParamField body="OnHelpDeskMsg" type="boolean">
  Whether to notify this active user about new help desk messages for their locations..
</ParamField>

<ParamField body="OnNewWallPost" type="boolean">
  Whether to notify this active user about new community wall posts for their locations..
</ParamField>

<ParamField body="OnNewMember" type="boolean">
  Whether to notify this active user when a new customer profile is created for their locations..
</ParamField>

<ParamField body="OnProfileChanges" type="boolean">
  Whether to notify this user about customer profile changes..
</ParamField>

<ParamField body="OnNewBlogComment" type="boolean">
  Whether to notify this active user with a customer profile at the location about new blog comments..
</ParamField>

<ParamField body="OnNewEventComment" type="boolean">
  Whether to notify this active user with a customer profile at the location about new calendar-event comments..
</ParamField>

<ParamField body="OnTariffChange" type="boolean">
  Whether to notify this active user about plan changes; virtual-office plans instead use OnVirtualOfficeTariffChange..
</ParamField>

<ParamField body="OnBookingChange" type="boolean">
  Whether to notify this active user about booking changes for their locations..
</ParamField>

<ParamField body="OnTentativeBookingChange" type="boolean">
  Whether to notify this active user about tentative booking changes for their locations..
</ParamField>

<ParamField body="OnPurchases" type="boolean">
  Whether to notify this active user about purchases for their locations..
</ParamField>

<ParamField body="OnVisitorRegistration" type="boolean">
  Whether to notify this user when visitors register at their locations..
</ParamField>

<ParamField body="OnPlaformInvoices" type="boolean">
  Whether to notify this user about Nexudus platform invoices for their locations..
</ParamField>

<ParamField body="ReceiveCommunityDigest" type="boolean">
  Whether this user is subscribed to scheduled community-board digest emails; new accounts inherit the location digest setting..
</ParamField>

<ParamField body="ReceiveEveryMessage" type="boolean">
  Whether this user receives an email for each new community-board message instead of only digest notifications..
</ParamField>

<ParamField body="TwoFactorSecret" type="string">
  Two-factor authentication secret; never expose or set it..
</ParamField>

<ParamField body="EmailCallBackGuid" type="string">
  Internal token-invalidating password-hash claim; never expose or set it..
</ParamField>

<ParamField body="Businesses" type="integer[]">
  List of locations this staff account can access; the account is included in location-scoped user queries only when linked to that location..
</ParamField>

<ParamField body="UserRoles" type="integer[]">
  List of location-scoped user roles that grant this account permissions; administrator access may grant permissions independently..
</ParamField>

<ParamField body="ChatRooms" type="integer[]">
  Internal list of support chat rooms linked to this user; manage chat membership outside the Admin Agent..
</ParamField>

<ParamField body="LastReceivedCommunityThreadDate" type="string">
  Internal timestamp of the latest community thread included in this user's notification tracking..
</ParamField>

<ParamField body="LastReceivedCommunityMessageDate" type="string">
  Internal timestamp of the latest community message included in this user's notification tracking..
</ParamField>

<ParamField body="NextCommunityDigest" type="string">
  Internal timestamp for this user's next scheduled community digest..
</ParamField>

<ParamField body="SupportTeamUserEmail" type="string">
  Internal support-team routing email associated with this account..
</ParamField>

<ParamField body="LastLoginAttempt" type="string">
  Internal timestamp of the most recent failed login attempt, used with InvalidLoginAttempts for lockout handling..
</ParamField>

<ParamField body="OnAccessControlErrors" type="boolean">
  Whether to notify this user about access-control errors for their locations..
</ParamField>

<ParamField body="NextHelpDeskMessageReminder" type="string">
  Timestamp of the next help desk message reminder for this user..
</ParamField>

<ParamField body="OnMemberRemovedFromTeam" type="boolean">
  Whether to notify this user when a customer is removed from a team..
</ParamField>

<ParamField body="OnVirtualOfficeTariffChange" type="boolean">
  Whether to notify this active user about virtual-office plan changes for their locations..
</ParamField>

<ParamField body="OnVirtualOfficeDeliveryPreferenceUpdate" type="boolean">
  Whether to notify this user when a virtual-office customer updates delivery preferences..
</ParamField>

<ParamField body="OnIdentityCheckUpdate" type="boolean">
  Whether to notify this user when a customer's identity-check status changes..
</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
}
```
