> ## 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 a new customer. Also creates a new profile.

> Currently only possible for channel WhatsApp.




## OpenAPI

````yaml /openapi/chat-client.yaml post /customers
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:
    post:
      tags:
        - customers
      summary: Add a new customer. Also creates a new profile.
      description: |
        Currently only possible for channel WhatsApp.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                channel:
                  type: string
                  enum:
                    - whatsapp
                display_id:
                  description: >
                    For WhatsApp: phone number in international format without
                    leading "+", special characters and spaces.

                    Must be unique among channel "whatsapp".

                    Will be saved as phone number in profile.
                  type: string
                  example: 491521234567
                name:
                  description: Name of customer and profile.
                  type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
components:
  schemas:
    Customer:
      description: |
        Represents a customer using a messenger service.
        A person with a phone number registered on WhatsApp is a customer.
      type: object
      properties:
        id:
          type: integer
        channel:
          $ref: '#/components/schemas/Channel'
        display_id:
          type: string
          description: An unique identifier within a channel.
          example: 4915223567929
        canonical_id:
          type: string
          nullable: true
          description: >
            Additional ID that identifies the customer. Currently used for
            WhatsApp.

            In WhatsApp, the display_id is either the phone number or the
            username.

            The canonical_id is always the BSUID (see WhatsApp usernames
            documentation).

            For other channels, the canonical_id is not used.
          example: DE.abc123
        name:
          type: string
          description: Name received from channel.
          example: John Doe
        username:
          type: string
          nullable: true
          description: Self given username. See WhatsApp usernames.
          example: john_doe
        profile:
          $ref: '#/components/schemas/ProfileSummary'
        conversations:
          description: Not always included.
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
    Channel:
      description: Type of messenger service.
      type: string
      enum:
        - bridge
        - whatsapp
        - facebook
        - widget
    ProfileSummary:
      description: >
        Profile data of a customer, without the nested list of other customers
        on the same profile.

        Used when embedding a profile inside a customer, to avoid re-embedding
        the customer itself.
      type: object
      properties:
        id:
          type: integer
        salutation:
          type: string
          enum:
            - formal_male
            - formal_female
            - informal
        name:
          type: string
          example: John Doe
        gender:
          type: string
          enum:
            - undisclosed
            - male
            - female
            - diverse
        blocked:
          type: boolean
          description: If a profile is blocked, receiving messages will be disabled.
        date_of_birth:
          type: string
          format: date
          nullable: true
          example: '1970-01-01'
        phone_number:
          description: Phone number in international format.
          type: string
          nullable: true
          example: '+4915224367929'
        email:
          type: string
          format: email
          nullable: true
        address:
          type: string
          nullable: true
        custom_1:
          description: >-
            One of five custom fields. Names of custom fields can be configured
            via settings.
          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
        created_at:
          description: Datetime when profile was created.
          type: string
          format: date-time
          nullable: true
          example: '2023-01-01T12:00:00Z'
        updated_at:
          description: Datetime when profile was last updated.
          type: string
          format: date-time
          nullable: true
          example: '2023-01-01T12:00:00Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````