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

# List case messages



## OpenAPI

````yaml https://api.prets.io/v1/openapi.json get /v1/cases/{caseId}/messages
openapi: 3.1.0
info:
  title: Prets API
  version: 1.0.0
servers:
  - url: https://api.prets.app
security:
  - bearerAuth: []
paths:
  /v1/cases/{caseId}/messages:
    get:
      summary: List case messages
      parameters:
        - schema:
            type: string
            pattern: ^cas_[0-9A-HJKMNP-TV-Z]{26}$
            description: Platform case id (`cas_{ULID}`)
            example: cas_01ARZ3NDEKTSV4RRFFQ69G5AV
          required: true
          description: Platform case id (`cas_{ULID}`)
          name: caseId
          in: path
        - schema:
            type: string
            description: Opaque list Cursor from a previous links.next.cursor (API-0013)
          required: false
          description: Opaque list Cursor from a previous links.next.cursor (API-0013)
          name: cursor
          in: query
        - schema:
            type: integer
            exclusiveMinimum: 0
            maximum: 250
            description: >-
              Page-size hint for the first page (1–250). Frozen into the Cursor
              for the rest of the scroll; ignored when `cursor` is present.
          required: false
          description: >-
            Page-size hint for the first page (1–250). Frozen into the Cursor
            for the rest of the scroll; ignored when `cursor` is present.
          name: limit
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: >-
              Repeated field names on the list item to expand. Allowlisted:
              none. Unknown names are invalid.
          required: false
          description: >-
            Repeated field names on the list item to expand. Allowlisted: none.
            Unknown names are invalid.
          name: expand
          in: query
      responses:
        '200':
          description: Messages listed successfully, oldest first
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCaseMessagesResponse'
        '400':
          description: Bad request — malformed cursor or expand
        '401':
          description: Unauthorized - authentication required
        '404':
          description: Case not found
        '500':
          description: Internal server error
components:
  schemas:
    ListCaseMessagesResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CaseMessage'
        hasMore:
          type: boolean
          description: True when another page exists; always equals links.next != null
        links:
          $ref: '#/components/schemas/ListLinks'
      required:
        - data
        - hasMore
        - links
      description: Paginated case conversation, oldest first
    CaseMessage:
      type: object
      properties:
        messageId:
          type: string
          pattern: ^csmsg_[0-9A-HJKMNP-TV-Z]{26}$
          description: Platform case message id (`csmsg_{ULID}`)
          example: csmsg_01ARZ3NDEKTSV4RRFFQ69G5AV
        body:
          type: string
          description: Plain-text message body. Tombstones use `[verwijderd]`.
          example: We have received your request.
        author:
          $ref: '#/components/schemas/CaseMessageAuthor'
        createdAt:
          type: string
          format: date-time
          description: When the message was posted (ISO 8601)
          example: '2024-12-31T14:30:00.000Z'
        redactedAt:
          type: string
          format: date-time
          description: When ops erased the body in Salesforce. Present only on tombstones.
          example: '2026-08-16T07:10:00.000Z'
      required:
        - messageId
        - body
        - author
        - createdAt
      additionalProperties: false
      description: >-
        One message in a Case conversation. Immutable through the API; erasure
        is a tombstone.
    ListLinks:
      type: object
      properties:
        next:
          type:
            - object
            - 'null'
          properties:
            href:
              type: string
              description: >-
                Relative URI-reference to the next page (also advertised on the
                Link header)
            cursor:
              type: string
              description: >-
                Opaque Cursor to pass as the cursor query param on the next
                request
          required:
            - href
            - cursor
          description: Next page link, or null when done
      required:
        - next
    CaseMessageAuthor:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CaseMessageAuthorType'
        contactId:
          type: string
          pattern: ^con_[0-9A-HJKMNP-TV-Z]{26}$
          description: Platform contact id of a merchant author; omitted for Prets replies
          example: con_01HYQ4R7T0WKM2XB8ZFPC3NDV9
        name:
          type: string
          description: Display name of a merchant author; omitted for Prets replies
          example: Jane Advisor
      required:
        - type
      additionalProperties: false
      description: >-
        Who wrote a Case message. Merchant authors are identifiable; Prets
        replies are institutional.
    CaseMessageAuthorType:
      type: string
      enum:
        - merchant
        - prets
      description: >-
        Which side wrote the message. `agent` and `system` are reserved for
        later additive values.
      example: merchant
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````