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

# Update customer

> Updates customer's fields. Allows clearing the values of `name`, `email`, `phone_number`, and `address` components by providing an empty string as the new field value.

**Required scopes:** `customers:rw`


## OpenAPI

````yaml /api/agent-chat/v3.7/openapi.json post /action/update_customer
openapi: 3.0.0
info:
  title: Agent Chat API
  description: >-
    The Agent Chat API allows you to manage chats, threads, events, and agent
    state.
  version: '3.7'
servers:
  - url: https://api.livechatinc.com/v3.7/agent
    description: Production server
security: []
paths:
  /action/update_customer:
    post:
      tags:
        - Customers
      summary: Update customer
      description: >-
        Updates customer's fields. Allows clearing the values of `name`,
        `email`, `phone_number`, and `address` components by providing an empty
        string as the new field value.
      operationId: update-customer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomerRequest'
            example:
              id: b7eff798-f8df-4364-8059-649c35c9ed0c
              name: Thomas Anderson
              email: t.anderson@example.com
              avatar: https://example.com/avatars/1.png
              session_fields:
                - custom_key: custom_value
                - another_custom_key: another_custom_value
      responses:
        '200':
          description: Customer updated.
      security:
        - PersonalAccessToken: []
        - OAuth2BearerToken:
            - customers:rw
components:
  schemas:
    UpdateCustomerRequest:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: The customer ID. The UUID v4 format is required.
        name:
          type: string
          description: The customer's name.
        email:
          type: string
          description: The customer's email.
        avatar:
          type: string
          description: The URL of the customer's avatar.
        phone_number:
          type: string
          description: The customer's phone number in E.164 format.
        session_fields:
          type: array
          items:
            type: object
          description: >-
            An array of custom object-enclosed key-value pairs. Respects the
            order of items.
        omnichannel:
          type: object
          description: The customer's omnichannel data.
          properties:
            fbmessenger:
              type: object
              properties:
                id:
                  type: string
                  description: >-
                    The Facebook Messenger ID. Required when
                    `omnichannel.fbmessenger` is provided.
                name:
                  type: string
                  description: The Facebook Messenger display name.
                first_name:
                  type: string
                  description: The customer's first name.
                last_name:
                  type: string
                  description: The customer's last name.
                profile_pic:
                  type: string
                  description: The URL of the customer's profile picture.
                gender:
                  type: string
                  description: The customer's gender.
                locale:
                  type: string
                  description: The customer's locale.
                is_verified_user:
                  type: boolean
                  description: 'If set to `true`: the customer is a verified Facebook user.'
            twilio:
              type: object
              properties:
                phone_number:
                  type: string
                  description: >-
                    The Twilio phone number. Required when `omnichannel.twilio`
                    is provided.
            whatsapp:
              type: object
              properties:
                id:
                  type: string
                  description: >-
                    The WhatsApp ID. Required when `omnichannel.whatsapp` is
                    provided.
                name:
                  type: string
                  description: The WhatsApp display name.
                phone_number:
                  type: string
                  description: >-
                    The WhatsApp phone number, in E.164 format. Required when
                    `omnichannel.whatsapp` is provided.
        address:
          type: object
          description: The customer's address.
          properties:
            address:
              type: string
              description: The street address.
            city:
              type: string
              description: The city name.
            country:
              type: string
              description: The country name.
            state:
              type: string
              description: The state name.
            postal_code:
              type: string
              description: The postal code.
  securitySchemes:
    PersonalAccessToken:
      description: >-
        Use your `account ID` as the username and your personal access token
        (PAT) as the password, or pass a Base64-encoded value directly in the
        Authorization header. For more information, see the <a
        href="/authentication/personal-access-tokens">personal access tokens
        guide</a>.
      type: http
      scheme: basic
    OAuth2BearerToken:
      description: >-
        This API uses OAuth2 with the implicit grant flow. <a
        href="/authentication/oauth-authorization#implicit-grant">Learn about
        the implicit grant flow.</a>
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.livechat.com
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of
        authorizationCode:
          authorizationUrl: https://accounts.livechat.com
          tokenUrl: https://accounts.livechat.com/token
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of

````