# Create a user

Adds a person to your account and returns the created record. The response
carries only the fields the create actually set, so it is a smaller object
than reading the same person back afterwards - read them again if you need
the full record.
**Which fields are required depends on the account.** `first_name` and
`last_name` always are. Whether `email` and `dob` are required is an account
setting, so the same body can be accepted on one account and rejected on
another; if you integrate against several, send both.
Custom attributes are sent alongside the fields below, under the codes the
account defines for them. Creating a person may send them a welcome email,
depending on how the account is configured.

Endpoint: POST /api/v2/user
Version: 2.0.0
Security: default

## Header parameters:

  - `Rosterfy-Platform` (string)

## Request fields (application/json):

  - `email` (string, required)
    The email address of the User. Must be unique.

  - `first_name` (string, required)
    The first name of the User

  - `last_name` (string, required)
    The last name of the User

  - `dob` (string, required)
    Date of birth in Y-m-d format

  - `phone` (string)
    Phone number

  - `terms` (boolean, required)
    Whether the User has accepted the terms and conditions.

  - `address` (object)
    The address of the User.

  - `picture` (string)

  - `account_role` (array)
    An ID of an account role (Admin Permission) to place User into.

  - `user_checkpoint_id` (integer)
    The ID of the checkpoint the user should be placed into.

  - `user_type_id` (integer)
    Set the User Type of the User.

  - `invitation_token` (string)

  - `custom_*` (string)
    A custom attribute, named by its code - custom_shirt_size, for example. The value follows the attribute's own type, so it may be a string, a number, a boolean or a list. See the custom attributes documentation.

## Response 201 fields (application/json):

  - `object` (object)

  - `object.email` (string)

  - `object.first_name` (string)

  - `object.last_name` (string)

  - `object.dob` (string)

  - `object.phone` (string)

  - `object.terms` (boolean)

  - `object.account_id` (integer)

  - `object.is_unreachable` (integer)

  - `object.email_verified` (integer)

  - `object.is_unreachable_sms` (integer)

  - `object.id_token` (string)

  - `object.is_subscribed_transactional` (boolean)

  - `object.updated_at` (string)

  - `object.created_at` (string)

  - `object.id` (integer)

  - `object.interests` (string | null)

  - `nice` (object)

  - `nice.rrn` (string)

  - `nice.address` (string)

  - `nice.address_oneline` (string)

  - `nice.family_id` (string | null)

  - `nice.has_family_members` (string)

  - `nice.manages_family` (boolean)

  - `nice.family_manager` (string)

  - `nice.family_member` (string)

  - `nice.is_family_member` (boolean)

  - `nice.is_engaged` (string)

  - `nice.is_engaged:raw` (boolean)

  - `nice.last_engaged_at` (string | null)

  - `nice.last_engaged_at:raw` (string | null)

  - `nice.created_at` (string)

  - `nice.created_at__date` (string)

  - `nice.created_at__time` (string)

  - `nice.created_at__offset` (string)

  - `nice.created_at__offset_minutes` (integer)

  - `nice.created_at__dayofweek` (string)

  - `nice.email_verified` (string)

  - `nice.from_source` (string)

  - `nice.interests` (string | null)

  - `nice.interests:value` (string | null)

  - `nice.interests:array` (string | null)

  - `nice.is_subscribed_transactional` (string)

  - `nice.is_team_leader` (string)

  - `nice.middle_name` (string)

  - `nice.picture_status` (string)

  - `nice.picture_status:value` (string | null)

  - `nice.picture_status:array` (string | null)

  - `nice.shift_privacy` (string)

  - `nice.updated_at` (string)

  - `nice.updated_at__date` (string)

  - `nice.updated_at__time` (string)

  - `nice.updated_at__offset` (string)

  - `nice.updated_at__offset_minutes` (integer)

  - `nice.updated_at__dayofweek` (string)

  - `nice.first_name` (string)

  - `nice.last_name` (string)

  - `nice.preferred_name` (string)

  - `nice.phone:qr_code_value` (string)

  - `nice.phone` (string)

  - `nice.phone:raw` (string)

  - `nice.phone:local_au` (string)

  - `nice.dob` (string)

  - `nice.dob__dayofweek` (string)

  - `nice.is_subscribed` (string)

  - `nice.terms` (string)

  - `nice.name` (string)

  - `nice.age` (integer)

  - `nice.age_months` (string)

  - `nice.info` (string)

  - `nice.preferred_first_name` (string)

  - `nice.delete_requested` (boolean)

  - `nice.updated_hours` (number)

  - `nice.is_community_user` (boolean)

  - `nice.timezone` (string)

  - `relations` (object)

  - `relations.family_user` (string | null)

  - `relations.user_type` (string | null)

  - `relations.user_checkpoint` (string | null)

  - `relations.family` (string | null)

  - `permissions` (object)

  - `permissions.read` (boolean)

  - `permissions.update` (boolean)

  - `permissions.delete` (boolean)

  - `permissions.impersonate` (boolean)

  - `attributes` (object)

  - `id` (integer)

  - `name` (string)

## Response 422 fields (application/json):

  - `message` (string)

  - `errors` (object)

  - `errors.first_name` (array)

  - `errors.last_name` (array)

