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

# Get

> Returns chats ordered by latest message date using cursor pagination.

Args:
per_page (int, optional): Defaults to 12.
cursor (str, optional): Cursor for pagination
search_term (str, optional): a search param representing a patient name or phone number
patient_id (str, optional): filter by specific patient ID
chat_id (str, optional): prioritize specific chat ID in results
unread_only (bool, optional): filter to only unread chats
unresponded_only (bool, optional): filter to chats where last message was from patient
location_id (str, optional): filter to patients at current user's location only
human_only (bool, optional): filter to chats where latest message is from humans (not AI assistants)



## OpenAPI

````yaml get /comms/chat/list
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /comms/chat/list:
    get:
      tags:
        - provider
        - comms
      summary: Get
      description: >-
        Returns a list of Chats and the latest message in the chat, ordered by
        the latest message date by a patient or


        Args:
            per_page (int, optional): Defaults to QueryParam(12).
            page (int, optional): Defaults to QueryParam(1).
            search_term (str, optional): a search param representing a patient name or phone number
            patient_id (str, optional): filter by specific patient ID
            query_param_chat_id (str, optional): prioritize specific chat ID in results
            unread_only (bool, optional): filter to only unread chats
            unresponded_only (bool, optional): filter to chats where last message was from patient
            location_id (str, optional): filter to patients at current user's location only
            human_only (bool, optional): filter to chats where latest message is from humans (not AI assistants)
      operationId: get_comms_chat_list_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Page
        - name: per_page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Per Page
        - name: sort_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Sort By
        - name: sort_direction
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - asc
                  - desc
              - type: 'null'
            title: Sort Direction
        - name: location_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Location Id
        - name: search_term
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Search Term
        - name: patient_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Patient Id
        - name: chat_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Chat Id
        - name: unread_only
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Unread Only
        - name: unresponded_only
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Unresponded Only
        - name: human_only
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Human Only
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_ChatSummary_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Page_ChatSummary_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ChatSummary'
          type: array
          title: Data
        total:
          type: integer
          title: Total
      type: object
      required:
        - data
        - total
      title: Page[ChatSummary]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChatSummary:
      properties:
        id:
          type: string
          title: Id
        primaryPatientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Primarypatientid
        status:
          $ref: '#/components/schemas/ChatStatus'
        patients:
          items:
            $ref: '#/components/schemas/ChatPatient'
          type: array
          title: Patients
        phoneNumber:
          type: string
          title: Phonenumber
        latestMessageContent:
          anyOf:
            - type: string
            - type: 'null'
          title: Latestmessagecontent
        latestMessageDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Latestmessagedate
        createdDate:
          type: string
          format: date-time
          title: Createddate
        optedOutOfSms:
          type: boolean
          title: Optedoutofsms
      type: object
      required:
        - id
        - primaryPatientId
        - status
        - patients
        - phoneNumber
        - createdDate
        - optedOutOfSms
      title: ChatSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ChatStatus:
      type: string
      enum:
        - READ
        - UNREAD
      title: ChatStatus
    ChatPatient:
      properties:
        id:
          type: string
          title: Id
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstname
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
        primaryLocationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Primarylocationid
      type: object
      required:
        - id
        - firstName
        - lastName
        - primaryLocationId
      title: ChatPatient

````