{
  "openapi": "3.0.1",
  "info": {
    "title": "Address Book APIs",
    "description": "The Address Book APIs provide operations to manage address book data used across shipping and contact management workflows.\nThe address book acts as a reusable data source for storing sender, recipient, and organizational contact information. Instead of entering the same details repeatedly in shipment or communication workflows, contact records can be created once and referenced later.\n**Contact**- An address book record containing personal or business contact details such as name, company, email, phone, and address information\n**Department**- An organizational grouping used to manage and retrieve department-level contact associations\n",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api-sandbox.sendpro360.pitneybowes.com/addressbookmgmt",
      "description": "Sandbox Server"
    },
    {
      "url": "https://api.sendpro360.pitneybowes.com/addressbookmgmt",
      "description": "Production Server (uses live data)"
    }
  ],
  "tags": [
    {
      "name": "Contact",
      "description": "APIs for managing contact records in the address book. They are used to maintain reusable sender, recipient, and business contact information for downstream workflows."
    },
    {
      "name": "Department",
      "description": "APIs for retrieving department records and their associated contacts. They are used to organize and access address book data at a department level for operational and administrative workflows."
    }
  ],
  "paths": {
    "/api/v1/contact": {
      "post": {
        "tags": [
          "Contact"
        ],
        "summary": "Create Contact",
        "description": "This operaion add a new Contact in the Address book.",
        "operationId": "addContact",
        "parameters": [
          {
            "name": "X-PB-Developer-Partner-ID",
            "in": "header",
            "description": "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.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/contactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The Contact has been added successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "description": "The unique identifier for the newly added contact, used as `contactId` in other APIs.",
                  "example": "6763e149671f04cace818d76"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "description": "Unauthorized Error",
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "description": "Bad Request",
            "$ref": "#/components/responses/NotFoundError"
          },
          "500": {
            "description": "Internal Server Error",
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v1/contact/{contactId}": {
      "get": {
        "tags": [
          "Contact"
        ],
        "summary": "Get Contact by contactID",
        "description": "This API retrieves the details of a contact using the unique `contactId`. The `contactId` is generated when the contact is created.",
        "operationId": "getContact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "description": "This is the unique identifier of the contact to be find.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "6763e149671f04cace818d76"
            }
          },
          {
            "name": "idType",
            "in": "query",
            "description": "This is the personnel ID assigned to a user when a contact is created.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "personnelID"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The Contact is retrive successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetriveContactDetailsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "description": "Unauthorized Error",
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "description": "Bad Request",
            "$ref": "#/components/responses/NotFoundError"
          },
          "500": {
            "description": "Internal Server Error",
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "tags": [
          "Contact"
        ],
        "summary": "Update Contact details",
        "description": "This operation will update existing contact's details.",
        "operationId": "updateContact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "description": "This is the unique identifier of the contact to be updated. The `contactId` is generated at the time of contact creation.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "6763e149671f04cace818d76"
            }
          },
          {
            "name": "idType",
            "in": "query",
            "description": "This is the personnel ID assigned to a user when a contact is created.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "personnelID"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/contactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contact has been updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Empty"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "description": "Unauthorized Error",
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "description": "Bad Request",
            "$ref": "#/components/responses/NotFoundError"
          },
          "500": {
            "description": "Internal Server Error",
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "tags": [
          "Contact"
        ],
        "summary": "Update specific fields of Contact",
        "description": "This operation updates specific fields of contact.Only the fields that need to be updated should be provided in the request. All other fields of the existing address will remain unchanged.",
        "operationId": "updateSpecificContactField",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "description": "This is the unique identifier of the contact to be updated. This is  generated at the time of contact creation.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "6763e149671f04cace818d76"
            }
          },
          {
            "name": "idType",
            "in": "query",
            "description": "This is the personnel ID assigned to a user when a contact is created.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "personnelID"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/contactpatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contact has been updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Empty"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "description": "Unauthorized Error",
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "description": "Bad Request",
            "$ref": "#/components/responses/NotFoundError"
          },
          "500": {
            "description": "Internal Server Error",
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "tags": [
          "Contact"
        ],
        "summary": "Delete contact",
        "description": "This operation deletes an existing Contact from the address book using its `contactId`.",
        "operationId": "deleteContact",
        "parameters": [
          {
            "name": "contactId",
            "in": "path",
            "description": "This is the unique identifier of the contact to be deleted.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "6763e149671f04cace818d76"
            }
          },
          {
            "name": "idType",
            "in": "query",
            "description": "This is the personnel ID assigned to a user when a contact is created.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "personnelID"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The contact has been deleted sucessfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Empty"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "description": "Unauthorized Error",
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "description": "Bad Request",
            "$ref": "#/components/responses/NotFoundError"
          },
          "500": {
            "description": "Internal Server Error",
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v1/contact/search": {
      "get": {
        "tags": [
          "Contact"
        ],
        "summary": "Get Contact list or Search Contact",
        "description": "This operation retrieves a list of contacts or searches for specific contacts based on the provided filters.",
        "operationId": "searchContact",
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "description": "The number of records to skip for pagination. Default is 0.",
            "schema": {
              "type": "integer",
              "example": "0"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The maximum number of records to return. Default is 20.",
            "schema": {
              "type": "integer",
              "example": "20"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Specifies the sorting criteria for the returned list.  \nUse `name:asc` for ascending or `name:desc` for descending order based on the contact name.\n",
            "schema": {
              "type": "string",
              "default": "name:asc"
            }
          },
          {
            "name": "searchBy",
            "in": "query",
            "required": false,
            "description": "Search contacts using default, name, company, email, otherNames, countryCode, street, city, state, postalCode, phone, uniqueID",
            "schema": {
              "type": "string",
              "example": "name:John"
            }
          },
          {
            "name": "filterBy",
            "in": "query",
            "required": false,
            "description": "Filter with order [begins ,contains, ends] on name, company fields and contactType ALL, SENDER, RECIPIENT.",
            "schema": {
              "type": "string",
              "example": "name:begins&contactType:ALL"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The Contact list has been retrived successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RetriveContactDetailsResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "description": "Unauthorized Error",
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "description": "Bad Request",
            "$ref": "#/components/responses/NotFoundError"
          },
          "500": {
            "description": "Internal Server Error",
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v1/departments": {
      "get": {
        "tags": [
          "Department"
        ],
        "summary": "Get Department list",
        "description": "This operation retrieves all the departments. (For now, departments can only be created from the UI.)",
        "operationId": "getDepartments",
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "description": "Number of records to skip from the start of the result set. Used for pagination. Default is 0.",
            "schema": {
              "type": "integer",
              "example": "0"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return in the response. Used for pagination.",
            "schema": {
              "type": "integer",
              "example": "20"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "required": false,
            "description": "Filters departments by the specified location ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "description": "Retrieves department details for the specified department ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The Department list has been retrived successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveDepartmentDetailsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "description": "Unauthorized Error",
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "description": "Bad Request",
            "$ref": "#/components/responses/NotFoundError"
          },
          "500": {
            "description": "Internal Server Error",
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v1/departments/{departmentId}/contacts": {
      "get": {
        "tags": [
          "Department"
        ],
        "summary": "Get Contact list for a Department",
        "description": "This operation retrieves all the contacts of the specified department",
        "operationId": "getDepartmentContacts",
        "parameters": [
          {
            "name": "departmentId",
            "in": "path",
            "description": "Identifier of the department whose contact list needs to be retrieved.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "description": "The number of records to skip for pagination. Default is 0.",
            "schema": {
              "type": "integer",
              "example": "0"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The maximum number of records to return. Default is 20.",
            "schema": {
              "type": "integer",
              "example": "20"
            }
          },
          {
            "name": "sendKeyContacts",
            "in": "query",
            "required": false,
            "description": "If true, retrieves only key contacts associated with departments",
            "schema": {
              "type": "boolean",
              "example": false
            }
          },
          {
            "name": "removePrivate",
            "in": "query",
            "required": false,
            "description": "If true, removes private contacts from the response",
            "schema": {
              "type": "boolean",
              "example": false
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The Contact list has been retrived successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveDepartmentContactDetailsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "$ref": "#/components/responses/BadRequestError"
          },
          "401": {
            "description": "Unauthorized Error",
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "description": "Bad Request",
            "$ref": "#/components/responses/NotFoundError"
          },
          "500": {
            "description": "Internal Server Error",
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "unauthorizedError": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "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."
          }
        },
        "required": [
          "message"
        ]
      },
      "serverError": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "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."
          }
        },
        "required": [
          "message"
        ]
      },
      "invalidErrors": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "errorCode": {
              "type": "string",
              "description": "Error code(s) that appear due to HTTP  400- Invalid or Bad Request, e.g., validation-error.",
              "example": "validation_error"
            },
            "errorDescription": {
              "type": "string",
              "description": "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": {
              "type": "string",
              "description": "A unique identifier for the error, for example 1101055, 0100008, or 1021126.",
              "example": "already_exists"
            },
            "additionalInfo": {
              "type": "string",
              "description": "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": {
              "type": "array",
              "items": {
                "type": "string",
                "description": "The field(s) that might be incorrect in the request."
              }
            }
          }
        }
      },
      "notFoundErrors": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "errorCode": {
              "type": "string",
              "example": "not_found",
              "description": "Error code(s) that appear due HTTP 404 Page or File not found."
            },
            "errorDescription": {
              "type": "string",
              "example": "resource not found",
              "description": "The HTTP 404 Not Found response status code indicates that the server cannot find the requested resource."
            },
            "additionalCode": {
              "type": "string",
              "description": "A unique identifier for the error, for example 0100025, 1110017, or 1090001."
            },
            "additionalInfo": {
              "type": "string",
              "description": "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": {
              "type": "array",
              "items": {
                "type": "string",
                "description": "The field(s) that might be incorrect in the request."
              }
            }
          }
        }
      },
      "Empty": {
        "title": "Empty Schema",
        "type": "object"
      },
      "contactRequest": {
        "type": "object",
        "properties": {
          "personnelId": {
            "type": "string",
            "description": "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": {
            "type": "string",
            "description": "This is the type of contact:\n- `S`: Shared contact created at the subscription level and accessible to all users within the subscription.\n- `U`: Contact created at the user level and private to that user only.\n- Default is subscription.\n",
            "example": "S",
            "enum": [
              "S",
              "U"
            ]
          },
          "contactType": {
            "type": "string",
            "description": "The type of contact to be created/updated. \n - `RECIPIENT`: The contact  is a recipient.\n - `SENDER`: The contact is a sender.\n - `ALL`: The contact can be both sender and recipient.\n",
            "enum": [
              "RECIPIENT",
              "SENDER",
              "ALL"
            ],
            "example": "RECIPIENT"
          },
          "name": {
            "type": "string",
            "description": "The name of the contact to be created/updated.",
            "example": "ContactTrans_101"
          },
          "company": {
            "type": "string",
            "description": "The company name associated with the contact to be created/updated.",
            "example": "Pitney Bowes"
          },
          "addresses": {
            "type": "array",
            "description": "A list of address for the contact to be created/updated.",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "description": "The label for the address, such as Home or Work.",
                  "example": "Home"
                },
                "residential": {
                  "type": "boolean",
                  "description": "If the address is residential.",
                  "example": false
                },
                "addressLine1": {
                  "type": "string",
                  "description": "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"
                },
                "addressLine2": {
                  "type": "string",
                  "description": "The addressLine2 contains Street address or Landmark (if any).",
                  "example": "near abc street"
                },
                "city": {
                  "type": "string",
                  "description": "City or town of the address.",
                  "example": "Shelton"
                },
                "state": {
                  "type": "string",
                  "description": "State or province of the address. It is the `2-letter` State or Province Code for US address(es).",
                  "example": "CT"
                },
                "postalCode": {
                  "type": "string",
                  "description": "The Postal Code or ZIP Code of the address. <br /> For US addresses, use only `9-digit` ZIP Code.",
                  "example": "06484-4361"
                },
                "countryCode": {
                  "type": "string",
                  "description": "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. <br /> 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. <br /> Below is the hyperlink, please select `Country codes` and then click `SEARCH` button. <br /> `Max length = 2`",
                  "example": "US"
                },
                "default": {
                  "type": "boolean",
                  "description": "Set it true to make it default address of the contact.",
                  "example": true
                }
              }
            }
          },
          "email": {
            "type": "object",
            "description": "The email details of the contact.",
            "properties": {
              "label": {
                "type": "string",
                "description": "The label for the email address, such as Home or Work.",
                "example": "Home"
              },
              "email": {
                "type": "string",
                "description": "The email address of the contact.",
                "example": "testuser@yopmail.com"
              }
            }
          },
          "additionalEmailIds": {
            "type": "array",
            "description": "A list of additional email addresses for the contact.",
            "items": {
              "type": "string",
              "example": "testemail@yopmail.com.com"
            }
          },
          "phone": {
            "type": "object",
            "description": "The phone details of the contact.",
            "properties": {
              "label": {
                "type": "string",
                "description": "The label for the phone number, such as Home or Work.",
                "example": "Home"
              },
              "phone": {
                "type": "string",
                "description": "The phone number of the contact.",
                "example": "2037963184"
              },
              "isdCode": {
                "type": "string"
              }
            }
          },
          "customFields": {
            "type": "array",
            "description": "custom fields associated with the contact.",
            "items": {
              "type": "object",
              "properties": {
                "customFieldId": {
                  "type": "string",
                  "description": " Identifier for the custom field.",
                  "example": "xxx"
                },
                "value": {
                  "type": "string",
                  "description": "Value assigned to the custom field.",
                  "example": "123"
                }
              }
            }
          },
          "otherNames": {
            "type": "array",
            "description": "A list of other names associated with the contact.",
            "items": {
              "type": "string",
              "example": "testotherNames1"
            }
          },
          "internalDelivery": {
            "type": "object",
            "description": "Internal package delivery preferences within the organization.",
            "properties": {
              "enabledInternalDelivery": {
                "type": "boolean",
                "description": "If the internal delivery is enabled for the contact.",
                "example": true
              },
              "mailStopId": {
                "type": "string",
                "description": "The unique identifier for the mailstop associated with the contact.",
                "example": "4a0e2Bbshdh"
              },
              "officeLocationId": {
                "type": "string",
                "description": "The unique identifier for the office location associated with the contact. This follows the location hierarchy: Site > Building > Floor > Mail Stop.",
                "example": "4a0e2Bb4Njw"
              }
            }
          },
          "notification": {
            "type": "object",
            "description": "Notification preferences for the contact.",
            "properties": {
              "enabledEmailNotification": {
                "type": "boolean",
                "description": "If the email notifications are enabled for the contact.",
                "example": true
              },
              "enabledSMSNotification": {
                "type": "boolean",
                "description": "If the SMS notifications are enabled for the contact.",
                "example": false
              },
              "enabledAccessibilityAccommodations": {
                "type": "boolean",
                "description": "If the accessibility accommodations (such as special handling or alerts) are enabled for the contact.",
                "example": false
              }
            }
          }
        }
      },
      "contactpatchRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The updated name of the contact if need to update contact name.",
            "example": "ContactTrans_102"
          },
          "company": {
            "type": "string",
            "description": "The updated company name of the contact if need to update contact name.",
            "example": "PB India"
          }
        }
      },
      "RetriveContactDetailsResponse": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "description": "The unique identifier for the contact searched.",
            "example": "6763e149671f04cace818d76"
          },
          "personnelID": {
            "type": "string",
            "description": "A unique identifier for the contact. One personnelId can be associated with only one contact. If not set, the personnelId will default to null.",
            "example": "12RT345"
          },
          "type": {
            "type": "string",
            "description": "This is the type of contact:\n- `S`: Shared contact created at the subscription level and accessible to all users within the subscription.\n- `U`: Contact created at the user level and private to that user only.\n- Default is Subscription.\n",
            "example": "S",
            "enum": [
              "S",
              "U"
            ]
          },
          "contactType": {
            "type": "string",
            "description": "The type of contact to be created. \n- `RECIPIENT`: The contact  is a recipient.\n- `SENDER`: The contact is a sender.\n- `ALL`: The contact can be both sender and recipient.\n",
            "enum": [
              "RECIPIENT",
              "SENDER",
              "ALL"
            ],
            "example": "RECIPIENT"
          },
          "name": {
            "type": "string",
            "description": "The name of the searched contact.",
            "example": "ContactTrans_101"
          },
          "company": {
            "type": "string",
            "description": "The company name associated with the searched contact.",
            "example": "Pitney Bowes"
          },
          "addresses": {
            "type": "array",
            "description": "A list of address of the searched contact.",
            "items": {
              "type": "object",
              "properties": {
                "Id": {
                  "type": "number",
                  "description": "This is unique identifier of the address.",
                  "example": 1
                },
                "label": {
                  "type": "string",
                  "description": "The label for the address, such as Home or Work.",
                  "example": "Home"
                },
                "residential": {
                  "type": "boolean",
                  "description": "If the address is residential.",
                  "example": false
                },
                "addressLine1": {
                  "type": "string",
                  "description": "The addressLine1 contains the Flat number, Building or Apartment Name/number (if any) or company name (if not residential) of the Sender. <br/> Max length = 35.",
                  "example": "27 Waterview Dr"
                },
                "addressLine2": {
                  "type": "string",
                  "description": "The addressLine2 contains Street address or Landmark (if any).",
                  "example": "near abc street"
                },
                "addressLine3": {
                  "type": "string",
                  "description": "The addressLine3 contains P.O. Box (if any) near the address.",
                  "example": "near xyz street"
                },
                "city": {
                  "type": "string",
                  "description": "City or town of the address.",
                  "example": "Shelton"
                },
                "state": {
                  "type": "string",
                  "description": "State or province of the address. It is the `2-letter` State or Province Code for US address(es).",
                  "example": "CT"
                },
                "postalCode": {
                  "type": "string",
                  "description": "The Postal Code or ZIP Code of the address. <br /> For US addresses, use only `9-digit` ZIP Code.",
                  "example": "06484-4361"
                },
                "countryCode": {
                  "type": "string",
                  "description": "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. <br /> 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. <br /> Below is the hyperlink, please select `Country codes` and then click `SEARCH` button. <br /> `Max length = 2`",
                  "example": "US"
                },
                "default": {
                  "type": "boolean",
                  "description": "If the address is default address.",
                  "example": true
                }
              }
            }
          },
          "email": {
            "type": "object",
            "description": "The email detail of the searched contact.",
            "properties": {
              "label": {
                "type": "string",
                "description": "The label for the email address, such as Home or Work.",
                "example": "Home"
              },
              "email": {
                "type": "string",
                "description": "The email address of the searched contact.",
                "example": "testuser@yopmail.com"
              }
            }
          },
          "additionalEmailIds": {
            "type": "array",
            "description": "A list of additional email addresses of the searched contact.",
            "items": {
              "type": "string",
              "example": "test@pb.com"
            }
          },
          "phone": {
            "type": "object",
            "description": "The phone details of the searched contact.",
            "properties": {
              "label": {
                "type": "string",
                "description": "The label for the phone number, such as Home or Work.",
                "example": "Home"
              },
              "phone": {
                "type": "string",
                "description": "The phone number of the contact.",
                "example": "2037963184"
              },
              "isdCode": {
                "type": "string"
              }
            }
          },
          "customFields": {
            "type": "array",
            "description": "custom fields associated with the contact searched.",
            "items": {
              "type": "object",
              "properties": {
                "customFieldId": {
                  "type": "string",
                  "description": "Identifier for the custom field.",
                  "example": "xxx"
                },
                "value": {
                  "type": "string",
                  "description": "Value assigned to the custom field.",
                  "example": "123"
                }
              }
            }
          },
          "otherNames": {
            "type": "array",
            "description": "A list of other names associated with the searched contact.",
            "items": {
              "type": "string",
              "example": "testotherNames1"
            }
          },
          "insertTimestamp": {
            "type": "string",
            "description": "The timestamp when the contact was created.",
            "example": "2024-12-19T09:03:05.072Z"
          },
          "updateTimestamp": {
            "type": "string",
            "description": "The timestamp when the contact was last updated.",
            "example": "0001-01-01T00:00:00Z"
          },
          "archived": {
            "type": "boolean",
            "description": "If the contact is archived.",
            "example": false
          },
          "createdBy": {
            "type": "string",
            "description": "The ID of the user who created the contact.",
            "example": "0oa27r9p8nfpRUqvv0h8"
          },
          "updatedBy": {
            "type": "string",
            "description": "The ID of the user who last updated the contact.",
            "example": "0oa27r9p8nfpRUqvv0h8"
          },
          "internalDelivery": {
            "type": "object",
            "description": "Internal package delivery preferences within the organization.",
            "properties": {
              "enabledInternalDelivery": {
                "type": "boolean",
                "description": "If the internal delivery is enabled for the contact.",
                "example": true
              },
              "mailStopId": {
                "type": "string",
                "description": "The unique identifier for the mailstop associated with the contact.",
                "example": "4a0e2Bbshdh"
              },
              "officeLocationId": {
                "type": "string",
                "description": "The unique identifier for the office location associated with the contact. This follows the location hierarchy: Site > Building > Floor > Mail Stop.",
                "example": "4a0e2Bb4Njw"
              }
            }
          },
          "notification": {
            "type": "object",
            "description": "Notification preferences for the contact.",
            "properties": {
              "enabledEmailNotification": {
                "type": "boolean",
                "description": "If the email notifications are enabled for the contact.",
                "example": true
              },
              "enabledSMSNotification": {
                "type": "boolean",
                "description": "If the SMS notifications are enabled for the contact.",
                "example": false
              },
              "enabledAccessibilityAccommodations": {
                "type": "boolean",
                "description": "If the accessibility accommodations (such as special handling or alerts) are enabled for the contact.",
                "example": false
              }
            }
          }
        }
      },
      "RetrieveDepartmentDetailsResponse": {
        "type": "object",
        "properties": {
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          },
          "departments": {
            "type": "array",
            "description": "List of departments.",
            "items": {
              "type": "object",
              "properties": {
                "departmentId": {
                  "type": "string",
                  "example": "dept123",
                  "description": "The unique identifier for the department."
                },
                "name": {
                  "type": "string",
                  "example": "Sales",
                  "description": "The name of the department associated with the contact."
                },
                "subId": {
                  "type": "string",
                  "example": "sub123",
                  "description": "The subscription Id associated with the department."
                },
                "locationId": {
                  "type": "string",
                  "example": "loc123",
                  "description": "The location Id associated with the department."
                },
                "archived": {
                  "type": "boolean",
                  "example": false,
                  "description": "Indicates if the department is archived."
                },
                "status": {
                  "type": "string",
                  "example": "ACTIVE",
                  "description": "The status of the department."
                },
                "insertTimestamp": {
                  "type": "string",
                  "example": "2024-12-19T09:03:05.072Z",
                  "description": "The timestamp when the department was created."
                },
                "updateTimestamp": {
                  "type": "string",
                  "example": "2024-12-20T10:15:30.123Z",
                  "description": "The timestamp when the department was last updated."
                },
                "createdBy": {
                  "type": "string",
                  "example": "0oa27r9p8nfpRUqvv0h8",
                  "description": "User ID of the user who created the department."
                },
                "updatedBy": {
                  "type": "string",
                  "example": "0oa27r9p8nfpRUqvv0h8",
                  "description": "User ID of the user who last updated the department."
                },
                "onBehalfUpdatedBy": {
                  "type": "string",
                  "example": "0oa27r9p8nfpRUqvv0h8",
                  "description": "The UserAdminAccessUID of the user who last updated the department."
                }
              }
            }
          }
        }
      },
      "RetrieveDepartmentContactDetailsResponse": {
        "type": "object",
        "properties": {
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          },
          "contacts": {
            "type": "array",
            "description": "List of contacts.",
            "items": {
              "$ref": "#/components/schemas/RetriveContactDetailsResponse"
            }
          }
        }
      },
      "PageInfo": {
        "type": "object",
        "properties": {
          "totalCount": {
            "type": "integer",
            "description": "Total number of records available.",
            "example": 1
          },
          "startCount": {
            "type": "integer",
            "description": "Current page number.",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "description": "Number of records per page.",
            "example": 20
          }
        }
      }
    },
    "responses": {
      "UnauthorizedError": {
        "description": "The request could not be authorized.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/unauthorizedError"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "The request could not be completed due to an internal error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/serverError"
            }
          }
        }
      },
      "BadRequestError": {
        "description": "Invalid request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/invalidErrors"
            }
          }
        }
      },
      "NotFoundError": {
        "description": "The requested resource was not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/notFoundErrors"
            }
          }
        }
      }
    }
  }
}