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

# List messages in a conversation

> Retrieves messages, notes, and events from a specific conversation in reverse chronological order. Supports pagination using the before parameter to fetch older entries. Returns a mix of messages, notes, and conversation events in a unified timeline.

<Warning>**Upcoming changes!**<br /><br />This endpoint returns `id` in the form `[x]-[id]`, such as `m-1234` for messages, `n-4321` for notes, and `e-6789` for events, but the messages and notes endpoints expects the id as integer, without the first part.<br /><br />We will soon update this endpoint API **without notification** to remove the first parts (`m-`, `n-` and `e-`) so you should conditionnaly strip these, and rely on the `type` property to know if it's a message, note or event.<br /><br />Thank you for your understanding.</Warning>


## OpenAPI

````yaml https://api.getfernand.com/openapi.json get /conversations/{id}/messages
openapi: 3.0.3
info:
  title: Fernand API Documentation
  version: '3.0'
  description: This is the documentation for the [Fernand](https://getfernand.com) API.
  termsOfService: https://getfernand.com/terms
  contact:
    name: Fernand Support
    url: https://getfernand.com
    email: support@getfernand.com
  x-logo:
    url: https://app.getfernand.com/images/favicon/icon_128.png
servers:
  - url: https://api.getfernand.com
    description: ''
    x-last-modified: 1764750693905
security:
  - apiKeyHeader: []
externalDocs:
  description: You can access our documentation online by visiting https://api.fernand.help
  url: https://api.fernand.help
paths:
  /conversations/{id}/messages:
    get:
      tags:
        - Messages
      summary: List messages in a conversation
      description: >-
        Retrieves messages, notes, and events from a specific conversation in
        reverse chronological order. Supports pagination using the before
        parameter to fetch older entries. Returns a mix of messages, notes, and
        conversation events in a unified timeline.
      operationId: listConversationMessages
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
          description: ID of the conversation to retrieve messages from.
        - name: before
          in: query
          required: false
          schema:
            type: string
          description: >
            Timestamp or Unix epoch (in seconds or milliseconds) to fetch
            messages before.

            Accepts ISO 8601 format or Unix timestamp. Used for pagination to
            load older messages.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 5
            maximum: 100
            default: 20
          description: Maximum number of entries to return.
      responses:
        '200':
          description: Messages retrieved successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/Message'
                    - $ref: '#/components/schemas/ConversationNote'
                    - $ref: '#/components/schemas/ConversationEvent'
        '400':
          description: Invalid timestamp or limit provided.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '404':
          description: Conversation not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    Message:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the message
          example: m-123456
        conversation_id:
          type: integer
          format: int64
          description: ID of the conversation this message belongs to
          example: 12345
        type:
          type: string
          enum:
            - MESSAGE
          description: Type of entry (always MESSAGE for messages)
          example: MESSAGE
        download_url:
          type: string
          nullable: true
          description: URL to download the original email file (.eml), if available
          example: >-
            https://api.getfernand.com/conversations/a1b2c3d4-e5f6-7890-abcd-ef1234567890/original.eml?token=abc123
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the message was created
          example: '2026-01-21T14:30:00Z'
        agent_id:
          type: integer
          format: int64
          nullable: true
          description: ID of the agent who sent the message (null for incoming messages)
          example: 42
        way:
          type: string
          enum:
            - IN
            - OUT
          description: Direction of the message (IN for incoming, OUT for outgoing)
          example: IN
        contact_id:
          type: integer
          format: int64
          nullable: true
          description: ID of the contact who sent the message (null for outgoing messages)
          example: 789
        message:
          type: string
          description: HTML content of the message body
          example: <p>Hello, I need help with my account.</p>
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
          description: Array of file attachments in the message
        status:
          type: string
          enum:
            - DRAFT
            - PENDING
            - SENT
            - RECEIVED
            - BOUNCED
            - SPAM
            - ERROR
          description: Current status of the message
          example: SENT
        delay:
          type: integer
          format: int32
          description: Delay in seconds before the message is sent (for scheduled messages)
          example: 0
        source:
          type: string
          enum:
            - EMAIL
            - CHAT
          description: Source channel of the message
          example: EMAIL
        unsubscribe_url:
          type: string
          nullable: true
          description: URL for the recipient to unsubscribe, if available
          example: https://newsletter.hooli.com/unsubscribe?token=xyz789
        last_event:
          allOf:
            - $ref: '#/components/schemas/MessageEvent'
          nullable: true
          description: Most recent delivery event for this message
        actions:
          type: array
          items:
            type: object
          description: Array of automated actions triggered by this message
        language:
          type: string
          nullable: true
          description: Detected language code of the message content (e.g., en, fr, es)
          example: en
        is_read:
          type: boolean
          description: >-
            Whether the message has been read by the recipient (chat messages
            only)
          example: false
        is_automated:
          type: boolean
          description: Whether this message was sent automatically by the system
          example: false
      required:
        - id
        - conversation_id
        - type
        - timestamp
        - way
        - status
        - source
      x-computed-hash: f06a9fad859d70eed1fa800c0c475119662f50b53898da1b3e6443b836ce35be
      x-last-modified: 1773150592
    ConversationNote:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the note
          example: n-123456
        agent_id:
          type: integer
          format: int64
          nullable: true
          description: ID of the agent who created the note
          example: 42
        conversation_id:
          type: integer
          format: int64
          description: ID of the conversation this note belongs to
          example: 12345
        message:
          type: string
          description: HTML content of the note
          example: <p>Customer mentioned they prefer email communication.</p>
        created:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the note was created
          example: '2026-01-21T14:30:00Z'
        type:
          type: string
          enum:
            - NOTE
          description: Type of entry (always NOTE for conversation notes)
          example: NOTE
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp for sorting entries (same as created)
          example: '2026-01-21T14:30:00Z'
        actions:
          type: array
          items:
            type: object
          description: Array of automated actions triggered by this note
        edited_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            ISO 8601 timestamp when the note was last edited, or null if never
            edited
          example: '2026-01-21T15:00:00Z'
      required:
        - id
        - conversation_id
        - message
        - created
        - type
        - timestamp
      x-computed-hash: 038dff7ecb709161310e1f432f81b912c8ba9915d38aed5f5fb7cccc5874d7d8
      x-last-modified: 1769075325
    ConversationEvent:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the event
          example: e-123456
        conversation_id:
          type: integer
          format: int64
          description: ID of the conversation this event belongs to
          example: 519508
        type:
          type: string
          enum:
            - EVENT
          description: Type of entry (always EVENT for conversation events)
          example: EVENT
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp for sorting entries
          example: '2026-01-21T17:46:22.877626Z'
        timestamp_ts:
          type: integer
          format: int64
          description: Unix timestamp in milliseconds corresponding to timestamp
          example: 1769017582877
        agent_id:
          type: integer
          format: int64
          nullable: true
          description: ID of the agent who triggered the event
          example: 2478
        event:
          type: string
          description: Event name
          example: CLOSED
        details:
          type: object
          nullable: true
          description: Optional event-specific details
        target_id:
          type: integer
          format: int64
          nullable: true
          description: Optional ID of the target affected by the event
      required:
        - id
        - conversation_id
        - type
        - timestamp
        - timestamp_ts
        - event
    Attachment:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the attachment
        name:
          type: string
          maxLength: 250
          description: Name of the attachment file
        url:
          type: string
          format: uri
          description: Download URL for the attachment
        type:
          type: string
          maxLength: 250
          description: MIME type of the attachment (content_type)
        size:
          type: integer
          format: int32
          description: Size of the attachment in bytes
        uuid:
          type: string
          format: uuid
          description: Unique UUID for the attachment
      required:
        - id
        - name
        - url
        - type
        - size
        - uuid
      x-computed-hash: e3f6f020dd720737f6114ca84de8255a075145ec2af171dfba4f88f71cfb4490
      x-last-modified: 1769075324
    MessageEvent:
      type: object
      properties:
        event:
          type: string
          enum:
            - QUEUED
            - CANCELED
            - DELIVERED
            - RECEIVED
            - SOFT_BOUNCE
            - HARD_BOUNCE
            - REJECTED
            - SPAM
            - ERROR
          description: Type of delivery event
          example: DELIVERED
        error_code:
          type: string
          maxLength: 10
          nullable: true
          description: Error code if the event represents a failure
          example: '550'
        reason:
          type: string
          maxLength: 250
          nullable: true
          description: Human-readable description of the event or error
          example: Message delivered successfully
        received_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the event was received
          example: '2026-01-21T14:31:00Z'
      required:
        - event
        - received_at
      x-computed-hash: 91b9f7e32e29a071b0d7ea10809ffe841a3ac3f59acecfdf33716d2010e8de35
      x-last-modified: 1769075324
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      description: >-
        Authenticate your account by including your secret key in API requests.

        You can manage your API keys in the
        [Dashboard](https://app.getfernand.com/).


        Authentication to the API is performed by using the HTTP Header
        X-API-Key.
      name: X-API-Key
      in: header
      x-last-modified: 1764750344730

````