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

# Get Messages for Contact

Returns all conversations and messages for a given `contact_id`.


## OpenAPI

````yaml get /get_contact_conversation_messages
openapi: 3.0.0
info:
  title: Chatzy AI API
  version: 1.0.0
  description: >-
    Chatzy AI REST API for messaging, contact conversations, and agent
    interactions.
  contact:
    name: Chatzy
    url: https://chatzy.ai
    email: support@chatzy.ai
servers:
  - url: https://vevdoh3hve.execute-api.us-east-1.amazonaws.com/prod
    description: Production Server
security: []
tags:
  - name: Authentication
    description: Authentication to access the API
  - name: Contact Conversations
    description: Get contact conversations
  - name: Conversational AI Agent Interactions
    description: Interact with the conversational AI agent
  - name: Authorized iframe Access
    description: APIs for authorized iframe access
paths:
  /get_contact_conversation_messages:
    get:
      tags:
        - Contact Conversations
      summary: Get Messages for Contact
      parameters:
        - name: contact_id
          in: query
          required: true
          description: The unique ID of the contact to fetch messages for.
          schema:
            type: string
            example: 096662f6-5acc-4699-923c-f7326936b39f
        - name: channel
          in: query
          required: false
          description: Filter messages by communication channel.
          schema:
            type: string
            enum:
              - whatsapp
              - instagram
              - messenger
              - website
            example: whatsapp
        - name: limit
          in: query
          required: false
          description: Maximum number of messages to return.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
            example: 50
        - name: offset
          in: query
          required: false
          description: >-
            Number of messages to skip before starting to collect the result
            set.
          schema:
            type: integer
            minimum: 0
            default: 0
            example: 0
        - name: grouped_conversations
          in: query
          required: false
          description: >-
            Whether to group messages by conversation, when set to false, the
            response will contain a flat list of messages.
          schema:
            type: boolean
            default: true
            example: true
      responses:
        '200':
          description: Contact with all conversations and messages.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          contact:
                            type: object
                            properties:
                              contact_id:
                                type: string
                              user_email_id:
                                type: string
                              first_name:
                                type: string
                              last_name:
                                type: string
                              phone_number:
                                type: string
                              created_at:
                                type: string
                                format: date-time
                              last_interacted_at:
                                type: string
                                format: date-time
                              contact_queries:
                                type: integer
                              is_blacklisted:
                                type: boolean
                              is_frozen:
                                type: boolean
                              frozen_until:
                                type: string
                                format: date-time
                          conversations:
                            type: array
                            items:
                              type: object
                              properties:
                                conversation_id:
                                  type: string
                                conversation_status:
                                  type: string
                                conversation_type:
                                  type: string
                                assigned_to:
                                  type: string
                                chatbot_id:
                                  type: string
                                messages:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      message_id:
                                        type: string
                                      content:
                                        type: string
                                      role:
                                        type: string
                                      created_at:
                                        type: string
                                        format: date-time
                                      message_order:
                                        type: integer
                                      wa_messages:
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            status:
                                              type: string
                                            created_at:
                                              type: string
                                              format: date-time
                                            data:
                                              type: object
                                      instagram_messages:
                                        type: array
                                        items: {}
                                      messenger_messages:
                                        type: array
                                        items: {}
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use the `idToken` retrieved from `/get_id_token` as the Bearer token.

````