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

# List conversation messages

> Returns up to 50 messages for a conversation.

Use `cursor` from `cursors.next` to page forward (newer messages) or from `cursors.prev` to page backward (older messages).



## OpenAPI

````yaml /openapi.json get /conversations/{conversationId}/messages
openapi: 3.1.0
info:
  title: Cogfy Public API
  version: 1.0.0
  description: API for interacting with the Cogfy platform
servers:
  - url: https://messenger-public-api.cogfy.com
    description: Production server
  - url: http://localhost:3100
    description: Local server
security:
  - ApiKeyAuth: []
tags: []
paths:
  /conversations/{conversationId}/messages:
    get:
      tags:
        - Conversations
      summary: List conversation messages
      description: >-
        Returns up to 50 messages for a conversation.


        Use `cursor` from `cursors.next` to page forward (newer messages) or
        from `cursors.prev` to page backward (older messages).
      parameters:
        - in: path
          name: conversationId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          required: true
        - in: query
          name: cursor
          schema:
            description: >-
              Opaque cursor returned by a previous call, used to fetch newer or
              older messages
            type: string
          description: >-
            Opaque cursor returned by a previous call, used to fetch newer or
            older messages
      responses:
        '200':
          description: A page of messages in the conversation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        workspaceId:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        conversationId:
                          anyOf:
                            - type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            - type: 'null'
                        assistantId:
                          anyOf:
                            - type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            - type: 'null'
                        userId:
                          anyOf:
                            - type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            - type: 'null'
                        broadcastId:
                          anyOf:
                            - type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            - type: 'null'
                        whatsappMessageId:
                          anyOf:
                            - type: string
                            - type: 'null'
                        from:
                          anyOf:
                            - type: string
                            - type: 'null'
                        to:
                          anyOf:
                            - type: string
                            - type: 'null'
                        role:
                          type: string
                        status:
                          anyOf:
                            - type: string
                            - type: 'null'
                        type:
                          anyOf:
                            - type: string
                            - type: 'null'
                        content:
                          anyOf:
                            - type: string
                            - type: 'null'
                        contentData:
                          anyOf:
                            - {}
                            - type: 'null'
                        toolCallId:
                          anyOf:
                            - type: string
                            - type: 'null'
                        toolCalls:
                          anyOf:
                            - type: array
                              items: {}
                            - type: 'null'
                        data:
                          anyOf:
                            - {}
                            - type: 'null'
                        contextId:
                          anyOf:
                            - type: string
                            - type: 'null'
                        contextFrom:
                          anyOf:
                            - type: string
                            - type: 'null'
                        createDate:
                          type: string
                          format: date-time
                          pattern: >-
                            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                        sendDate:
                          type: string
                          format: date-time
                          pattern: >-
                            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                        deliverDate:
                          anyOf:
                            - type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                            - type: 'null'
                        readDate:
                          anyOf:
                            - type: string
                              format: date-time
                              pattern: >-
                                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                            - type: 'null'
                        promptTokens:
                          anyOf:
                            - type: number
                            - type: 'null'
                        completionTokens:
                          anyOf:
                            - type: number
                            - type: 'null'
                        order:
                          type: number
                        traceId:
                          anyOf:
                            - type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                            - type: 'null'
                      required:
                        - id
                        - workspaceId
                        - conversationId
                        - assistantId
                        - userId
                        - broadcastId
                        - whatsappMessageId
                        - from
                        - to
                        - role
                        - status
                        - type
                        - content
                        - contentData
                        - toolCallId
                        - toolCalls
                        - data
                        - contextId
                        - contextFrom
                        - createDate
                        - sendDate
                        - deliverDate
                        - readDate
                        - promptTokens
                        - completionTokens
                        - order
                        - traceId
                      additionalProperties: false
                  cursors:
                    type: object
                    properties:
                      next:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: Opaque cursor for newer messages
                      prev:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: Opaque cursor for older messages
                    required:
                      - next
                      - prev
                    additionalProperties: false
                required:
                  - data
                  - cursors
                additionalProperties: false
        '400':
          description: Bad request, invalid cursor or conversation id
        '401':
          description: Unauthorized
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api-key

````