> ## 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 greeting

> Updates the properties of a greeting.

**Required scopes:** `greetings:rw`


## OpenAPI

````yaml /api/configuration/v3.7/openapi.json post /action/update_greeting
openapi: 3.1.0
info:
  title: Configuration API
  version: v3.7
servers:
  - url: https://api.livechatinc.com/v3.7/configuration
security:
  - PersonalAccessToken: []
  - OAuth2BearerToken: []
paths:
  /action/update_greeting:
    post:
      tags:
        - Greetings
      summary: Update greeting
      description: Updates the properties of a greeting.
      operationId: update-greeting
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateGreetingRequest'
            example:
              id: 123
              active: false
              name: Updated welcome greeting
              rules:
                - condition: and
                  type: url_current
                  operator: contains
                  value: product
              properties:
                addon: chat_widget
                is_exit_intent: 'true'
              rich_message:
                template_id: text
                elements:
                  - title: Updated greeting message!
                    subtitle: Can we help you find a product?
      responses:
        '200':
          description: Greeting updated successfully.
components:
  schemas:
    UpdateGreetingRequest:
      type: object
      required:
        - id
      properties:
        id:
          type: integer
          description: The ID of the greeting to update.
        type:
          type: string
          enum:
            - normal
            - announcement
          description: |-
            The greeting type.

            - `normal` — displayed on every visit.
            - `announcement` — displayed once per visitor.
        active:
          type: boolean
          description: 'The greeting status. If set to `true`: the greeting is active.'
        active_from:
          type: string
          format: date-time
          description: >-
            The RFC 3339 date-time format indicating when the greeting becomes
            active.
        active_until:
          type: string
          format: date-time
          description: >-
            The RFC 3339 date-time format indicating when the greeting stops
            being active.
        name:
          type: string
          description: The greeting name.
        rules:
          type: array
          maxItems: 10
          items:
            $ref: '#/components/schemas/GreetingRule'
          description: >-
            An array of action rules. See Create Greeting for detailed structure
            and validation.
        properties:
          type: object
          additionalProperties:
            type: string
          description: The additional properties. See Create Greeting for allowed keys.
        rich_message:
          $ref: '#/components/schemas/RichMessage'
          description: >-
            The rich message content. See Create Greeting for complete
            structure.
    GreetingRule:
      type: object
      required:
        - condition
        - type
      properties:
        condition:
          type: string
          enum:
            - and
            - or
          description: |-
            The logical condition for the rule.

            - `and` — match all conditions.
            - `or` — match one of the conditions.
        type:
          type: string
          enum:
            - visit_time_site
            - visit_time_page
            - url_current
            - url_visited
            - url_funnel
            - pages_view_number
            - url_referrer
            - geolocation
            - visits_number
            - search_keyword
            - custom_variable
            - ads_traffic
            - url_match_page_view_number
          description: >-
            The type of the rule condition.


            - `visit_time_site` — seconds spent on the entire website; requires
            `value` and `operator`.

            - `visit_time_page` — seconds spent on the current page; requires
            `value` and `operator`.

            - `url_current` — current page URL to match; requires `value` and
            `operator`.

            - `url_visited` — previously visited URL to match; requires `value`
            and `operator`.

            - `url_funnel` — a sequence of URLs; requires `urls`.

            - `pages_view_number` — number of pages viewed; requires `value` and
            `operator`.

            - `url_referrer` — referrer URL to match; requires `value` and
            `operator`.

            - `geolocation` — geographic location to match; requires `value` and
            `operator`.

            - `visits_number` — number of visits; requires `value` and
            `operator`.

            - `search_keyword` — search keyword to match; requires `value` and
            `operator`.

            - `custom_variable` — session field key-value pair; requires
            `session_field`.

            - `ads_traffic` — ad platform session field; requires
            `session_field`.

            - `url_match_page_view_number` — page view count for matched URLs;
            requires `value`, `operator`, and `urls`.
        operator:
          type: string
          enum:
            - equals
            - doesnt_equal
            - lower_than
            - lower_or_equal
            - greater_than
            - greater_or_equal
            - contains
            - doesnt_contain
          description: >-
            The comparison operator for the rule. Not required for `url_funnel`,
            `custom_variable`, and `ads_traffic` types.
        value:
          type: string
          description: >-
            The value to compare against, based on the selected `operator`.
            Required for most rule types.
        urls:
          type: array
          maxItems: 10
          items:
            $ref: '#/components/schemas/GreetingRuleUrl'
          description: >-
            An array of URL objects. Required only for the `url_funnel` and
            `url_match_page_view_number` types objects.
        session_field:
          type: object
          additionalProperties:
            type: string
          description: >-
            The key-value pairs. Required for `custom_variable` and
            `ads_traffic` types — exactly one element.
    RichMessage:
      type: object
      required:
        - template_id
      properties:
        template_id:
          type: string
          enum:
            - cards
            - sticker
            - quick_replies
          description: >-
            The template ID that defines how every rich message will be
            presented.
        elements:
          type: array
          maxItems: 10
          items:
            $ref: '#/components/schemas/RichMessageElement'
          description: The rich message elements element objects.
    GreetingRuleUrl:
      type: object
      required:
        - url
        - operator
      properties:
        url:
          type: string
          description: >-
            The URL for the `url_funnel` and `url_match_page_view_number` rules.
            Required when the `urls` array is used.
        operator:
          type: string
          enum:
            - equals
            - doesnt_equal
            - lower_than
            - lower_or_equal
            - greater_than
            - greater_or_equal
            - contains
            - doesnt_contain
          description: >-
            The operator for the URL comparison. Required when the `urls` array
            is used.
    RichMessageElement:
      type: object
      required:
        - title
        - subtitle
        - image
      properties:
        title:
          type: string
          description: The title text displayed on the rich message.
        subtitle:
          type: string
          description: The subtitle text displayed on the rich message.
        image:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              description: The image URL.
            name:
              type: string
              description: The image file name.
            content_type:
              type: string
              description: The MIME content type of the image.
            size:
              type: integer
              description: The image file size in bytes.
            width:
              type: integer
              description: The image width in pixels.
            height:
              type: integer
              description: The image height in pixels.
            alternative_text:
              type: string
              description: The alternative text for the image.
          description: The image displayed on the rich message.
        buttons:
          type: array
          maxItems: 13
          items:
            $ref: '#/components/schemas/RichMessageButton'
          description: Buttons displayed on the rich message button objects.
    RichMessageButton:
      type: object
      required:
        - text
        - type
        - value
        - postback_id
      properties:
        text:
          type: string
          description: The button text.
        type:
          type: string
          enum:
            - webview
            - message
            - url
            - phone
          description: >-
            The behavior after a user clicks the button. Should be used together
            with `value`.
        value:
          type: string
          description: >-
            The value associated with `type`. For the `webview` type, you can
            use this field to give the rich message a custom title.
        postback_id:
          type: string
          description: Unique identifier for this button, sent in postback events.
        button_id:
          type: string
          description: A button identifier. Automatically generated if not provided.
        role:
          type: string
          enum:
            - default
            - primary
            - danger
          description: The button role.
  securitySchemes:
    PersonalAccessToken:
      type: http
      scheme: basic
      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>.
    OAuth2BearerToken:
      type: http
      scheme: bearer
      description: Authenticate using an OAuth 2.0 Bearer token.
      x-example: us-south1:MQraNrGCsoJvtxD7KNJQB1kM3d5

````