# Create a new person

This endpoint allows you to add a new person to the Calamari.
The request must include essential details such as first name, last name,
e-mail address, approval process, work schedule, and holidays calendar.

Endpoint: POST /people/v2
Version: v1
Security: basicAuth

## Request fields (application/json):

  - `firstName` (string, required)
    Person's first name.
    Example: "John"

  - `middleName` (any)
    Person's middle name (Core HR module required).

  - `lastName` (string, required)
    Person's last name.
    Example: "Doe"

  - `email` (string, required)
    Valid email address.
    Example: "john.doe@example.com"

  - `approvalProcess` (string, required)
    Approval process name or identifier.

  - `workSchedule` (any, required)
    Work schedule name or identifier.

  - `holidaysCalendar` (any, required)
    Holidays calendar name or identifier.

  - `contractType` (string)
    Contract type name or identifier.

  - `hireDate` (any)
    Hire date in ISO 8601 format.

  - `birthdate` (any)
    Birthdate in ISO 8601 format (Core HR module required).

  - `sex` (string,null)
    Person's sex.
    Enum: "MALE", "FEMALE", "OTHER", null

  - `position` (any)
    Job position/title name or identifier.

  - `teams` (any)
    List of team names or identifiers the person belongs to.
    Example: ["Accountants",3]

  - `maritalStatus` (string,null)
    Describes a person's relationship with a significant other.
    Enum: "SINGLE", "MARRIED", "WIDOWED", "SEPARATED", "DIVORCED", "DOMESTIC_PARTNERSHIP", "COMMON_LAW", "OTHER", null

  - `terminationDate` (any)
    Termination date if applicable (ISO 8601 format).

  - `directManager` (string)
    Unique e-mail address or UUID of the direct manager.

  - `probationEndDate` (any)
    End date of probation period (ISO 8601 format).

  - `externalNumber` (any)
    External reference number for the person.

  - `symfoniaGuid` (any)
    GUID from Symfonia system (Time Off module required).

  - `customNote` (any)
    Custom note or additional information

  - `businessContact` (any)
    Business contact information (Core HR module required).

  - `personalContact` (any)
    Personal contact information (Core HR module required).

  - `seniorityBeforeHire` (any)
    Seniority in months before the hire date.

  - `address` (any)
    Person's home address (Core HR module required).

  - `emergencyContact` (any)
    Emergency contact details (Core HR module required).

  - `bankAccountNumber` (any)
    Person's bank account number (Core HR module required).

  - `contractorDetails` (any)
    Contractor-related details (Core HR module required).

  - `shirtSize` (any)
    Shirt size (Core HR module required).

  - `children` (array)
    List of persons' children (Core HR module required).

  - `children.firstName` (any)

  - `children.lastName` (any)

  - `children.birthdate` (any)

  - `children.sex` (string,null)
    Child's sex.
    Enum: "MALE", "FEMALE", "OTHER", null

  - `children.parent` (any)

  - `customFields` (array)
    Custom attributes assigned to the person (Core HR module required). One of text, multiline text, date, single-choice list, multiple choice list, numerical, boolean.

  - `customFields.name` (string, required)
    Example: "Skills/Languages spoken/Speaks fluently"

  - `customFields.value` (any, required)
    Custom field value. Can be single value or array of values in case Single Choice Custom Field or Multi Choice Custom Field. The value is restricted by selected type.

## Response 201 fields (application/json):

  - `id` (string, required)
    Example: "2c11e9ec-77d2-49fe-81aa-fab21f7b5aed"

  - `legacyId` (integer, required)
    Example: 1001

## Response 400 fields (application/json):

  - `type` (string, required)
    Example: "about:blank"

  - `title` (string, required)
    Example: "One or more validation errors occurred."

  - `detail` (string, required)
    Example: "Please refer to the errors property for additional details."

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

  - `instance` (number, required)
    Example: 1

  - `errors` (object)
    Example: {"lastName":["must not be blank"]}

## Response 401 fields (application/problem+json):

  - `title` (string, required)
    Type of error
    Example: "Authentication failure"

  - `status` (string, required)
    HTTP status code
    Example: 401

  - `detail` (string, required)
    Detailed error message explaining the issue.
    Example: "Please check if valid API key was provided"

## Response 403 fields (application/json):

  - `type` (string, required)
    Example: "about:blank"

  - `title` (string, required)
    Example: "Licence error."

  - `detail` (string, required)
    Example: "Time Off module required."

  - `status` (number, required)
    Example: 402

  - `instance` (number, required)
    Example: 1

## Response 429 fields (application/problem+json):

  - `title` (string, required)
    Type of error
    Example: "Request quota exceeded"

  - `status` (string, required)
    HTTP status code
    Example: 429

  - `detail` (string, required)
    Detailed error message explaining the issue.
    Example: "Your current usage is 101/day, 10/hour, 1/sec\nYour current limits 100/day, 10/hour, 1/sec."

## Response 500 fields (application/problem+json):

  - `title` (string, required)
    Type of error
    Example: "Internal server error."

  - `status` (string, required)
    HTTP status code
    Example: 500

  - `detail` (string, required)
    Detailed error message explaining the issue.
    Example: "Please try again later. If the issue persists, don't hesitate to reach to our Support via team@calamari.io"

## Response 504 fields (application/problem+json):

  - `title` (string, required)
    Type of error
    Example: "Public API call exceeded timeout."

  - `status` (string, required)
    HTTP status code
    Example: 504

  - `detail` (string, required)
    Detailed error message explaining the issue.
    Example: "Please try again later. If the issue persists, don't hesitate to reach to our Support via team@calamari.io"


