# Create user

Add a user to Transmit. A user_id is returned as part of the User in the response that can then be used to perform other operations, such as get, update and delete. An email or a phone_number are required.

Endpoint: POST /v1/users
Security: Bearer

## Request fields (application/json):

  - `email` (string)
    Primary email address of the user

  - `phone_number` (string)
    Primary phone number of the user, specified in E.164 format

  - `username` (string)
    Username used to identify the user
    Example: "<ADD USERNAME HERE>"

  - `secondary_emails` (array)
    Secondary email addresses to add to user's current emails

  - `secondary_phone_numbers` (array)
    Secondary phone numbers to add to user's phone numbers, each specified in E.164 format

  - `birthday` (string)
    User's birthday

  - `address` (object)
    User's address

  - `address.country` (string)
    Country

  - `address.state` (string)
    State

  - `address.city` (string)
    City

  - `address.street_address` (string)
    Street address

  - `address.postal_code` (string)
    Postal code

  - `address.type` (string)
    Enum: "home", "work", "other"

  - `name` (object)
    Object describing user's full name

  - `name.title` (string)
    Title

  - `name.first_name` (string)
    User's first name

  - `name.last_name` (string)
    User's last name

  - `name.middle_name` (string)
    User's middle name

  - `external_account_id` (string)
    User identifier in an app, set by the app

  - `custom_app_data` (object)
    Custom data object for app-related user info

  - `picture` (string)
    The picture of user, specified as a URL

  - `language` (string)
    The language of the user, as provided by the browser using the [Accept-Language](https://www.rfc-editor.org/rfc/rfc7231#section-5.3.5) header field

  - `custom_data` (object)
    Custom data object for tenant user info

  - `external_user_id` (string)
    A unique identifier in a tenant

  - `credentials` (object)
    The password of the user, who is identified by either a username or primary email.
    Example: {"password":"<ADD PASSWORD HERE>","force_replace":false}

  - `credentials.password` (string, required)
    The user's new password
    Example: "<ADD PASSWORD HERE>"

  - `credentials.force_replace` (boolean)
    When true the password is temporary and the user will be required to replace it upon successful login

  - `delegated_access` (object)
    If this user is a dependent, this defines the permissions that the primary user will have to act on behalf of the dependent user.

  - `delegated_access.actor_id` (string, required)
    The ID of the primary user that has permissions to act on behalf of this user

  - `delegated_access.permissions` (array, required)
    Names of permissions that are granted to the primary user on behalf of the dependent

## Response 201 fields (application/json):

  - `result` (object, required)

  - `result.email` (string)
    Primary email address, used as user identifier

  - `result.secondary_emails` (array)

  - `result.phone_number` (string)
    Primary phone number, used as user identifier

  - `result.secondary_phone_numbers` (array)

  - `result.username` (string)
    Username used to identify the user for password login (unless a primary email will be used instead). Defined only if a password was set for the user.

  - `result.user_id` (string, required)
    User ID autogenerated upon user creation

  - `result.birthday` (string)
    Birthday as YYYY-MM-DD

  - `result.address` (object)
    User's address

  - `result.address.country` (string)
    Country

  - `result.address.state` (string)
    State

  - `result.address.city` (string)
    City

  - `result.address.street_address` (string)
    Street address

  - `result.address.postal_code` (string)
    Postal code

  - `result.address.type` (string)
    Enum: "home", "work", "other"

  - `result.name` (object)
    Full name

  - `result.name.title` (string)
    Title

  - `result.name.first_name` (string)
    User's first name

  - `result.name.last_name` (string)
    User's last name

  - `result.name.middle_name` (string)
    User's middle name

  - `result.status` (string, required)
    Enum: "ACTIVE", "INACTIVE", "DISABLED"

  - `result.status_changed_at` (string)
    Date status was last updated

  - `result.created_at` (number, required)
    Date user was created in the tenant

  - `result.updated_at` (number, required)
    Date user was last updated

  - `result.last_auth` (string)
    Date user last authenticated

  - `result.external_account_id` (string)
    User identifier in an app, set by the app

  - `result.app_name` (string)
    Name of the app the user is associated with

  - `result.custom_app_data` (object)
    Custom data object for app-related user info

  - `result.groupIds` (array)
    List of group IDs the user is assigned to

  - `result.picture` (string)
    The picture of user, specified as a URL

  - `result.language` (string)
    The language of the user, as provided by the browser using the [Accept-Language](https://www.rfc-editor.org/rfc/rfc7231#section-5.3.5) header field

  - `result.custom_data` (object)
    Custom data object for tenant user info

  - `result.external_user_id` (string)
    A unique identifier in a tenant

  - `result.password_information` (object)
    The information of the user's password

  - `result.password_information.created_at` (string)

  - `result.password_information.updated_at` (string)

  - `result.password_information.expire_at` (string)
    The date when the password will expire

  - `result.password_information.last_failure_at` (string)
    The date when the last failure to authenticate occurred

## Response 400 fields (application/json):

  - `message` (array, required)
    Example: "Bad request"

  - `error_code` (number, required)
    Example: 400

## Response 409 fields (application/json):

  - `message` (string, required)

  - `error_code` (number, required)


