# Create Contact

This operaion add a new Contact in the Address book.

Endpoint: POST /api/v1/contact
Version: 1.0.0
Security: bearerAuth

## Header parameters:

  - `X-PB-Developer-Partner-ID` (string)
    The Developer Partner ID is assigned by Pitney Bowes to uniquely identify a Developer's strategic business partners. If the developer is the sole business partner, this field isn't required.

## Request fields (application/json):

  - `personnelId` (string)
    A unique identifier for the contact to be created/updated. One personnelId can be associated with only one contact. If not set, the personnelId will default to null.
    Example: 12RT345

  - `type` (string)
    This is the type of contact:
- `S`: Shared contact created at the subscription level and accessible to all users within the subscription.
- `U`: Contact created at the user level and private to that user only.
- Default is subscription.
    Enum: "S", "U"

  - `contactType` (string)
    The type of contact to be created/updated.
- `RECIPIENT`: The contact  is a recipient.
- `SENDER`: The contact is a sender.
- `ALL`: The contact can be both sender and recipient.
    Enum: "RECIPIENT", "SENDER", "ALL"

  - `name` (string)
    The name of the contact to be created/updated.
    Example: ContactTrans_101

  - `company` (string)
    The company name associated with the contact to be created/updated.
    Example: Pitney Bowes

  - `addresses` (array)
    A list of address for the contact to be created/updated.

  - `addresses.label` (string)
    The label for the address, such as Home or Work.
    Example: Home

  - `addresses.residential` (boolean)
    If the address is residential.
    Example: false

  - `addresses.addressLine1` (string)
    The addressLine1 contains the Flat number, Building or Apartment Name/number (if any) or company name (if not residential) of the Sender.
    Example: 27 Waterview Dr

  - `addresses.addressLine2` (string)
    The addressLine2 contains Street address or Landmark (if any).
    Example: near abc street

  - `addresses.city` (string)
    City or town of the address.
    Example: Shelton

  - `addresses.state` (string)
    State or province of the address. It is the `2-letter` State or Province Code for US address(es).
    Example: CT

  - `addresses.postalCode` (string)
    The Postal Code or ZIP Code of the address.  For US addresses, use only `9-digit` ZIP Code.
    Example: 06484-4361

  - `addresses.countryCode` (string)
    The country in which the contact's address is located. The value will be the two-character ISO Code of the country from the ISO country list.  Use ISO 3166-1 Alpha-2 standard values. For best results this should be included, especially if the country name does not appear in any of the unparsedAddressLines.  Below is the hyperlink, please select `Country codes` and then click `SEARCH` button.  `Max length = 2`
    Example: US

  - `addresses.default` (boolean)
    Set it true to make it default address of the contact.
    Example: true

  - `email` (object)
    The email details of the contact.

  - `email.label` (string)
    The label for the email address, such as Home or Work.
    Example: Home

  - `email.email` (string)
    The email address of the contact.
    Example: testuser@yopmail.com

  - `additionalEmailIds` (array)
    A list of additional email addresses for the contact.

  - `phone` (object)
    The phone details of the contact.

  - `phone.label` (string)
    The label for the phone number, such as Home or Work.
    Example: Home

  - `phone.phone` (string)
    The phone number of the contact.
    Example: 2037963184

  - `phone.isdCode` (string)

  - `customFields` (array)
    custom fields associated with the contact.

  - `customFields.customFieldId` (string)
    Identifier for the custom field.
    Example: xxx

  - `customFields.value` (string)
    Value assigned to the custom field.
    Example: 123

  - `otherNames` (array)
    A list of other names associated with the contact.

  - `internalDelivery` (object)
    Internal package delivery preferences within the organization.

  - `internalDelivery.enabledInternalDelivery` (boolean)
    If the internal delivery is enabled for the contact.
    Example: true

  - `internalDelivery.mailStopId` (string)
    The unique identifier for the mailstop associated with the contact.
    Example: 4a0e2Bbshdh

  - `internalDelivery.officeLocationId` (string)
    The unique identifier for the office location associated with the contact. This follows the location hierarchy: Site > Building > Floor > Mail Stop.
    Example: 4a0e2Bb4Njw

  - `notification` (object)
    Notification preferences for the contact.

  - `notification.enabledEmailNotification` (boolean)
    If the email notifications are enabled for the contact.
    Example: true

  - `notification.enabledSMSNotification` (boolean)
    If the SMS notifications are enabled for the contact.
    Example: false

  - `notification.enabledAccessibilityAccommodations` (boolean)
    If the accessibility accommodations (such as special handling or alerts) are enabled for the contact.
    Example: false

## Response 400 fields (application/json):

  - `errorCode` (string)
    Error code(s) that appear due to HTTP  400- Invalid or Bad Request, e.g., validation-error.
    Example: validation_error

  - `errorDescription` (string)
    The HTTP 400 Bad Request response status code indicates that the server cannot process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
    Example: Duplicate contact already exists.

  - `additionalCode` (string)
    A unique identifier for the error, for example 1101055, 0100008, or 1021126.
    Example: already_exists

  - `additionalInfo` (string)
    This is an additional information about the error. This error 'Invalid Request' might appear due to invalid data, or if the information is missing.
    Example: 674eb7b67b34d787400fa453

  - `additionalParameters` (array)

## Response 401 fields (application/json):

  - `message` (string, required)
    This is HTTP 401 Unauthorized response status code, which indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource.

## Response 404 fields (application/json):

  - `errorCode` (string)
    Error code(s) that appear due HTTP 404 Page or File not found.
    Example: not_found

  - `errorDescription` (string)
    The HTTP 404 Not Found response status code indicates that the server cannot find the requested resource.
    Example: resource not found

  - `additionalCode` (string)
    A unique identifier for the error, for example 0100025, 1110017, or 1090001.

  - `additionalInfo` (string)
    Additional information about the error. This error 'Not Found' might appear due to `Shipment Not Found`, `No Shipments to close`, or `Original Transaction not found`.

  - `additionalParameters` (array)

## Response 500 fields (application/json):

  - `message` (string, required)
    This is HTTP 500 Internal Server Error response status code, which indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

