# CreateUsers

Create new users

`POST /api/v2/accounts/{accountId}/users`

**API:** AvaTax API
**Tag:** Users
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/Users/CreateUsers/

## Description

Create one or more new user objects attached to this account.
            
A user represents one person with access privileges to make API calls and work with a specific account.
            
Users who are account administrators or company users are permitted to create user records to invite
additional team members to work with AvaTax.
            
A newly created user will receive an email inviting them to create their password.  This means that you
must provide a valid email address for all user accounts created.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, AvaTaxOnlyUserAdmin, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `accountId` | integer | path | Yes | The unique ID number of the account where these users will be created. |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `UserModel[]`

An account user who is permitted to use AvaTax.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | **Yes** | The unique ID number of this user. Example: `12345`. |
| `accountId` | integer | **Yes** | The unique ID number of the account to which this user belongs. Example: `123456789`. |
| `companyId` | integer | No | If this user is locked to one company (and its children), this is the unique ID number of the company to which this user belongs. Example: `123456`. |
| `userName` | string | **Yes** | The username which is used to log on to the AvaTax website, or to authenticate against API calls. Example: `bobExample`. |
| `firstName` | string | **Yes** | The first or given name of the user. Example: `Bob`. |
| `lastName` | string | **Yes** | The last or family name of the user. Example: `Example`. |
| `email` | string | **Yes** | The email address to be used to contact this user.  If the user has forgotten a password, an email can be sent to this email address with information on how to reset this password. Example: `bob@example.org`. |
| `postalCode` | string | No | The postal code in which this user resides. Example: `98110`. |
| `securityRoleId` | string | **Yes** | The security level for this user. Values: `NoAccess`, `SiteAdmin`, `AccountOperator`, `AccountAdmin`, `AccountUser`, `SystemAdmin`, `Registrar`, `CSPTester`, `CSPAdmin`, `SystemOperator`, `TechnicalSupportUser`, `TechnicalSupportAdmin`, `TreasuryUser`, `TreasuryAdmin`, `ComplianceUser`, `ComplianceAdmin`, `ProStoresOperator`, `CompanyUser`, `CompanyAdmin`, `ComplianceTempUser`, `ComplianceRootUser`, `ComplianceOperator`, `SSTAdmin`, `FirmUser`, `FirmAdmin`, `BatchServiceAdmin`, `ECMAccountUser`, `ECMCompanyUser`, `ReturnsOnlyAccountAdmin`, `ReturnsOnlyAccountUser`, `ReturnsOnlyCompanyAdmin`, `ReturnsOnlyCompanyUser`, `AvaTaxOnlyAccountAdmin`, `AvaTaxOnlyAccountUser`, `AvaTaxOnlyCompanyAdmin`, `AvaTaxOnlyCompanyUser`, `AvaTaxOnlyUserAdmin`. Example: `NoAccess`. |
| `passwordStatus` | string | No | The status of the user's password. For a new user created, this is always going to be `UserMustChange` Values: `UserCannotChange`, `UserCanChange`, `UserMustChange`. Example: `UserCannotChange`. |
| `isActive` | boolean | No | True if this user is currently active. Example: `true`. |
| `createdDate` | string | No | The date when this record was created. |
| `modifiedDate` | string | No | The date/time when this record was last modified. |
| `subjectId` | string | No | Matches the subjectId of corresponding user record in AI. |
| `migratedDate` | string | No | The date/time when this record was migrated to Avalara Identity modified. |
| `suppressNewUserEmail` | boolean | No | Suppress new user email |
| `isDeleted` | boolean | No | A boolean flag to identify if the user is deleted |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success |  |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |
| 404 | Not Found |  |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/accounts/{accountId}/users" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '[
  {
    "id": 12345,
    "accountId": 123456789,
    "companyId": 123456,
    "userName": "bobExample",
    "firstName": "Bob",
    "lastName": "Example",
    "email": "bob@example.org",
    "postalCode": "98110",
    "securityRoleId": "AccountUser",
    "passwordStatus": "UserCanChange",
    "isActive": true,
    "suppressNewUserEmail": false,
    "isDeleted": false
  }
]'
```