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

# Create Member

> Add a new member to your organization.

Create a new member (user) in your organization. This endpoint handles account creation, role assignment, and invitation delivery via email or SMS.

### REQUEST

```shell theme={null}
POST https://api.hellotracks.com/api/createaccount

{
   "data": {
      "name": "John Doe",
      "username": "johndoe@company.com",
      "password": "TempPass123!",
      "role": "worker",
      "phone": "+14155551234"
   }
}
```

<ParamField body="name" type="string" required>
  Full name of the user. **Required.**

  Example: `"John Doe"`, `"Sarah Johnson"`
</ParamField>

<ParamField body="username" type="string" required>
  Username for login, typically an email address. **Required.**

  Must be unique across the platform. If this username already exists in your company, the existing member will be reactivated instead of creating a duplicate.

  Example: `"worker@company.com"`
</ParamField>

<ParamField body="password" type="string">
  Initial password for the account. **Optional.**

  * If provided: Member can log in immediately with this password
  * If omitted: Member receives an invitation via email or SMS to set their own password

  **Recommendation:** Leave empty and let users set their own password for better security.
</ParamField>

<ParamField body="role" type="string" default="worker">
  Role determines the user's permissions. **Optional, defaults to "worker".**

  Available roles:

  * `"worker"` - Field worker with basic permissions (default)
  * `"operator"` or `"dispatcher"` - Dispatcher with management capabilities
  * `"administrator"` or `"admin"` - Full administrative access

  See [Member Object - Role & Permissions](/api-reference/member-object#role--permissions) for details.
</ParamField>

<ParamField body="phone" type="string">
  Phone number for the user. **Optional.**

  Used for SMS invitations (if password not set) and contact purposes.

  Format: Include country code, e.g., `"+14155551234"`
</ParamField>

### Account Reactivation

If you create a member with a `username` that already exists and was previously part of your company:

* The existing account will be **reactivated** instead of creating a new one
* Previous data and history are preserved
* The member is automatically re-added to your organization

This prevents duplicate accounts and maintains continuity.

### Automatic Invitation

After creating a member:

* An invitation is sent via email (if email username) or SMS (if phone provided)
* If no `password` is provided, the account is created with a temporary password and the invitation lets the new member complete onboarding
* Company members list is automatically updated via push notifications

### Permissions

* The authenticated account must belong to a company and the company must be allowed to add another member
* Account creation may fail if the company has reached plan or account limits

### RESPONSE

```shell theme={null}
{
  "status": 0,
  "uid": "abc123",
  "account": {
    "uid": "abc123",
    "username": "johndoe@company.com",
    "name": "John Doe",
    "phone": "+14155551234",
    "role": "worker",
    "teams": [],
    // ... complete member object
  }
}
```

<ResponseField name="status" type="integer" required>
  Status code. `0` indicates success.
</ResponseField>

<ResponseField name="uid" type="string" required>
  Unique identifier of the newly created (or reactivated) member. Use this UID for subsequent API calls.
</ResponseField>

<ResponseField name="account" type="object" required>
  Complete member object with all properties initialized. See the [Member API Object](/api-reference/member-object) for full structure.
</ResponseField>

### Examples

<RequestExample>
  ```bash Create Worker with Invite theme={null}
  curl -X POST https://api.hellotracks.com/api/createaccount \
    --header 'API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    -d '{
      "data": {
        "name": "Jane Smith",
        "username": "jane@company.com",
        "phone": "+14155559999"
      }
    }'
  ```

  ```bash Create Dispatcher with Password theme={null}
  curl -X POST https://api.hellotracks.com/api/createaccount \
    --header 'API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    -d '{
      "data": {
        "name": "Mike Johnson",
        "username": "mike@company.com",
        "password": "TempPass123!",
        "role": "dispatcher",
        "phone": "+14155558888"
      }
    }'
  ```

  ```bash Create Administrator theme={null}
  curl -X POST https://api.hellotracks.com/api/createaccount \
    --header 'API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    -d '{
      "data": {
        "name": "Admin User",
        "username": "admin@company.com",
        "role": "administrator"
      }
    }'
  ```
</RequestExample>

<Note>
  **Complete Field Reference:** See the [Member API Object](/api-reference/member-object) for documentation of all properties in the returned member object.
</Note>

<Tip>
  **Best Practice:** Don't set the `password` field. Let new members receive an invitation and set their own password for better security and user experience.
</Tip>

### Related Endpoints

* [Get Members](/api-reference/endpoint/getaccounts) - Retrieve member information
* [Edit Member](/api-reference/endpoint/editaccount) - Update member properties
* [Delete Member](/api-reference/endpoint/deleteaccount) - Remove members
