> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryhealvi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add new customers in bulk. Also creates new profile if a customer does not exist yet.

> Currently only possible for channel WhatsApp.




## OpenAPI

````yaml /openapi/chat-client.yaml post /customers/bulk-import
openapi: 3.0.3
info:
  version: 1.0.0
  title: HealviChat Client API
servers:
  - url: https://{tenant_domain}/third-party/v1
    variables:
      tenant_domain:
        default: your-tenant.onhealvi.com
        description: Your tenant domain
security:
  - bearerAuth: []
paths:
  /customers/bulk-import:
    post:
      tags:
        - customers
      summary: >-
        Add new customers in bulk. Also creates new profile if a customer does
        not exist yet.
      description: |
        Currently only possible for channel WhatsApp.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                duplicates:
                  description: >-
                    How to handle display IDs that already exist in the customer
                    database.
                  type: string
                  enum:
                    - override
                    - skip
                customers:
                  type: array
                  items:
                    type: object
                    properties:
                      channel:
                        type: string
                        enum:
                          - whatsapp
                      display_id:
                        description: >
                          For WhatsApp: phone number in international format
                          without leading "+", special characters and spaces.

                          Will be saved as phone number in profile.
                        type: string
                        example: 491521234567
                      name:
                        description: Name of customer and profile.
                        type: string
                      profile:
                        type: object
                        properties:
                          email:
                            description: Must be valid email address. Skipped otherwise.
                            type: string
                            nullable: true
                          date_of_birth:
                            description: |
                              Must be valid date. Skipped otherwise.
                              Supports YYYY-MM-DD and DD.MM.YYYY format.
                            type: string
                            nullable: true
                          address:
                            type: string
                            nullable: true
                          custom_1:
                            type: string
                            nullable: true
                          custom_2:
                            type: string
                            nullable: true
                          custom_3:
                            type: string
                            nullable: true
                          custom_4:
                            type: string
                            nullable: true
                          custom_5:
                            type: string
                            nullable: true
                          marketing_opt_in:
                            description: >-
                              Flag to indicate of customer has given consent to
                              receive marketing messages.
                            type: integer
                            example: 1
                            nullable: true
                          tags:
                            description: >-
                              Comma separated list of tags. New tags will be
                              created on the fly.
                            type: string
                            nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      created_count:
                        type: integer
                        description: Number of customers created.
                      updated_count:
                        type: integer
                        description: Number of existing customers updated.
                      skipped_count:
                        type: integer
                        description: Number of existing customers skipped.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````