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

# Message Read Webhook Request Body

> This endpoint must be implemented on YOUR server (e.g., https://yourdomain.com/webhooks/on-read). Treble will call this webhook when a message is read by the user. You must configure the URL of this webhook in the Treble admin panel.



## OpenAPI

````yaml open-api-files/treble-api-en.json POST /webhooks/on-read
openapi: 3.0.1
info:
  title: Treble Poll API
  description: Documentation for the poll deployment endpoint in Treble
  version: 1.0.0
servers:
  - url: https://main.treble.ai
    description: Main Treble server
  - url: https://yourdomain.com
    description: >-
      Example server for implementing webhooks. This represents YOUR server
      where you must implement the endpoints that Treble will call.
security: []
tags:
  - name: Webhooks
    description: >-
      Endpoints that Treble will call on your server. These are not real
      endpoints that you can call, but a representation of the webhooks that
      Treble will invoke in your system.
paths:
  /webhooks/on-read:
    post:
      tags:
        - Webhooks
      summary: Webhook - When a message is read
      description: >-
        This endpoint must be implemented on YOUR server (e.g.,
        https://yourdomain.com/webhooks/on-read). Treble will call this webhook
        when a message is read by the user. You must configure the URL of this
        webhook in the Treble admin panel.
      requestBody:
        description: Information of the read event
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReadEvent'
            example:
              country_code: '+57'
              cellphone: '3176477608'
              session_id: d2fa98d29a2670dfa119335df1b0371720d674f1677302aba228876a
              conversation_id: 34820
              question:
                type: open
                text: >-
                  Hello! Good morning. I hope everything is well. Would you like
                  to continue our conversation to resolve all your problems and
                  concerns?
              sent_at: '2021-06-22 15:19:06.473256'
              sent_text: >-
                Hello! Good morning. I hope everything is well. Would you like
                to continue our conversation to resolve all your problems and
                concerns?
              user_session_keys: []
              read_at: '2021-06-22 15:19:08'
      responses:
        '200':
          description: Response to update or add information to the session
          content:
            application/json:
              schema:
                type: object
                description: >-
                  JSON object with the new information that will be replaced or
                  added to the session for future use. The service must respond
                  in less than 10 seconds.
      servers:
        - url: https://yourdomain.com
          description: Your server where you must implement this webhook
components:
  schemas:
    ReadEvent:
      type: object
      required:
        - country_code
        - cellphone
        - session_id
        - conversation_id
        - question
        - sent_at
        - sent_text
        - read_at
      description: Event that is triggered when a message is read by the user
      properties:
        country_code:
          type: string
          description: Country code of the user
        cellphone:
          type: string
          description: User's phone number without the country code
        session_id:
          type: string
          description: ID of the user's session
        conversation_id:
          type: integer
          description: ID of the conversation
        question:
          $ref: '#/components/schemas/Question'
        sent_at:
          type: string
          format: date-time
          description: Date and time when the message was sent
        sent_text:
          type: string
          description: Text of the sent message
        user_session_keys:
          type: array
          description: >-
            User session keys collected during the conversation or provided
            during the deployment
          items:
            $ref: '#/components/schemas/UserSessionKey'
        read_at:
          type: string
          format: date-time
          description: Date and time when the message was read by the user
    Question:
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          description: Type of question
          example: open
        text:
          type: string
          description: Text of the question
    UserSessionKey:
      type: object
      required:
        - key
        - value
      properties:
        key:
          type: string
          description: >-
            Name of the variable. Special values include 'deployment_squad' to
            select which phone number will perform the deployment in
            multi-channel companies.
        value:
          type: string
          description: >-
            Value of the variable. For 'deployment_squad', the value must be
            'DS_[CELLPHONE]'.

````