# Quick create a team member

Creates a new team member with a minimal set of parameters.
Send `user_phone` and `user_email` as `null` to create a team member without a user account. A non-null value links the existing Altegio user with that phone number or email to the team member, inviting them to the location if they have no access to it yet; set `is_user_invite` to `true` to create the user account by invitation when no user matches.
On locations with per-seat licensing, `is_paid_staff` is required for an active team member. A paid team member takes a paid staff seat and counts against the location's team member limit; a non-paid team member takes no seat and cannot have schedule access (`has_timetable_access`).

Endpoint: POST /locations/{location_id}/team_members/quick
Version: 1.0.0
Security: BearerPartnerUser

## Security:

  - `BearerPartnerUser` (unknown)
    http bearer Bearer {PartnerToken}, User {UserToken}

## Path parameters:

  - `location_id` (number, required)
    ID of a location.

## Header parameters:

  - `Accept` (string, required)
    Required B2B v2 response media type. Use `application/vnd.api.v2+json`. A charset parameter is also accepted.

  - `Content-Type` (string, required)
    Should be equal to `application/json`

## Request fields (application/json):

  - `name` (string, required)
    Name of a team member.
    Example: John Johnson

  - `specialization` (string, required)
    Specialization of a team member.
    Example: Cosmetologist

  - `position_id` (number | null, required)
    ID of a position that should be linked to a team member, or `null` for none. The key is required.
    Example: 123

  - `phone_number` (string | null)
    Not read by this endpoint: the value is ignored and is not stored on the team member. To link or invite a user account by phone number, use `user_phone`.
    Example: 11234567890

  - `user_email` (string | null, required)
    Email of the user account to link to the team member, or `null` for a team member without a user account. The key is required. An existing user with this email is linked to the team member; if no user matches, the request fails unless `is_user_invite` is `true`.
    Example: john.johnson@example.com

  - `user_phone` (string | null, required)
    Phone number of the user account to link to the team member (without "+", 9 to 15 digits), or `null` for a team member without a user account. The key is required. An existing user with this phone number is linked to the team member; if no user matches, the request fails unless `is_user_invite` is `true`. When both `user_phone` and `user_email` are set, the invitation is addressed to the phone number.
    Example: 11234567890

  - `is_user_invite` (boolean, required)
    Whether to create a user account by invitation when no Altegio user matches `user_phone` or `user_email`. With `false`, a non-null `user_phone` or `user_email` must belong to an existing user; otherwise the request fails. With `true`, a missing user is created and invited, which requires the right to add users to the location. The flag does not decide whether an invitation is sent: an existing user without access to the location is invited either way. Has no effect when both `user_phone` and `user_email` are `null`.
    Example: false

  - `has_timetable_access` (boolean)
    Whether the team member has schedule access: they can be given a work schedule and take appointments. When omitted, it is `true` for a paid team member and `false` for a non-paid one on per-seat licensing, and `false` on other licensing models. On per-seat licensing, `true` is rejected for a non-paid team member.
    Example: true

  - `is_paid_staff` (boolean)
    Whether the team member takes a paid staff seat. Required for an active team member on locations with per-seat licensing, where a paid team member counts against the location's team member limit and a non-paid one cannot have schedule access. Ignored on other licensing models.
    Example: true

## Response 201:

  - `201` (unknown)
    Created

## Response 201 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: true

  - `data` (object)
    Example: {"id":123,"name":"John Johnson","company_id":123,"specialization":"Master","avatar":"https://app.alteg.io/images/no-master-sm.png","avatar_big":"https://app.alteg.io/images/no-master.png","position":{…

  - `data.id` (number)
    ID of a team member.

  - `data.name` (string)
    Name of a team member.

  - `data.company_id` (number)
    ID of a location, where team member was created.

  - `data.specialization` (string)
    Specialization of a team member.

  - `data.avatar` (string)
    Link to the avatar of a team member (small).

  - `data.avatar_big` (string)
    Link to the avatar of a team member (original).

  - `data.position` (object)
    Position of a team member.
    Example: {"id":123,"title":"Position"}

  - `data.position.id` (number)
    ID of a position.

  - `data.position.title` (string)
    Title of a position.

  - `data.is_paid_staff` (boolean)
    Whether the team member is a paid staff member counted in license price.

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

## Response 400:

  - `400` (unknown)
    Bad Request - a business rule refused the team member: on per-seat licensing, `is_paid_staff` is missing for an active team member or a non-paid team member was given schedule access; no user matches `user_phone` or `user_email` and `is_user_invite` is `false`; or the matching user is already linked to another team member of the location.

## Response 400 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: An error has occurred.

  - `meta.errors` (array)
    Set of a validation error messages.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

## Response 422:

  - `422` (unknown)
    Unprocessable Entity - a required key is missing or a value is invalid.

## Response 422 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: An error has occurred.

  - `meta.errors` (array)
    Set of a validation error messages.

