> ## 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@example.com",
      "password": "TempPass123!",
      "role": "worker",
      "phone": "+14155551234"
   }
}
```

**name** `string` *required*

Full name of the user. **Required.**

Example: `"John Doe"`, `"Sarah Johnson"`

**username** `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@example.com"`

**password** `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.

**role** `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](https://api-docs.hellotracks.com/api-reference/member-object.md#role--permissions) for details.

**phone** `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"`

### 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@example.com",
    "name": "John Doe",
    "phone": "+14155551234",
    "role": "worker",
    "teams": [],
    // ... complete member object
  }
}
```

**status** `integer` *required*

Status code. `0` indicates success.

**uid** `string` *required*

Unique identifier of the newly created (or reactivated) member. Use this UID for subsequent API calls.

**account** `object` *required*

Complete member object with all properties initialized. See the [Member API Object](https://api-docs.hellotracks.com/api-reference/member-object.md) for full structure.

### Examples

```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@example.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@example.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@example.com",
      "role": "administrator"
    }
  }'
```

> [!NOTE]
>
> **Complete Field Reference:** See the [Member API Object](https://api-docs.hellotracks.com/api-reference/member-object.md) for documentation of all properties in the returned member object.

> [!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.

### Related Endpoints

* [Get Members](https://api-docs.hellotracks.com/api-reference/endpoint/getaccounts.md) - Retrieve member information
* [Edit Member](https://api-docs.hellotracks.com/api-reference/endpoint/editaccount.md) - Update member properties
* [Delete Member](https://api-docs.hellotracks.com/api-reference/endpoint/deleteaccount.md) - Remove members


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.