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

# List ticket messages

> Return messages for a ticket.



## OpenAPI

````yaml https://api.initdesk.com/schema.yaml get /organizations/{organization_id}/tickets/{ticket_id}/messages/
openapi: 3.0.3
info:
  title: initdesk Customer API
  version: 1.19.0
  description: OpenAPI documentation for the customer-facing API served by the gateway.
servers:
  - url: https://api.initdesk.com
    description: Customer API gateway
security:
  - IntegrationToken: []
tags:
  - name: Organizations
    description: Organization metadata and context for all other resources.
  - name: Customers
    description: >-
      End users (requesters) scoped to the organization. Tickets reference
      customers by ID.
  - name: Tickets
    description: >-
      Tickets, messages, attachments, search, and statuses. A ticket is the
      conversation container; messages are nested under
      `/tickets/{pk}/messages/`.
  - name: Custom Preset Filters
    description: >-
      Saved ticket search filters scoped to the organization. Integration tokens
      receive organization-shared filters only.
  - name: Inboxes
    description: >-
      Organization mailboxes for routing tickets. Each inbox has an email prefix
      and optional default-inbox flag (is_default: true). On ticket create,
      inbox_id is optional: omit to use the default inbox, or provide an inbox
      ID to target a specific mailbox.
  - name: Tags
    description: Organization-scoped ticket tags with id, name, and optional color.
  - name: Help Center
    description: >-
      Support portal settings, knowledge base collections, articles, and article
      search.
paths:
  /organizations/{organization_id}/tickets/{ticket_id}/messages/:
    get:
      tags:
        - Tickets
      summary: List ticket messages
      description: Return messages for a ticket.
      operationId: list_ticket_messages
      parameters:
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: ticket_id
          schema:
            type: string
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMessageList'
          description: ''
      security:
        - IntegrationToken: []
components:
  schemas:
    PaginatedMessageList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Message'
    Message:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        author:
          allOf:
            - $ref: '#/components/schemas/User'
          readOnly: true
          nullable: true
          description: >-
            Legacy author object; may be deprecated for display in a future API
            version in favor of `sender`.
        role:
          enum:
            - customer
            - cc
            - associate
            - system
          type: string
          description: |-
            * `customer` - Customer
            * `cc` - Cc
            * `associate` - Associate
            * `system` - System
          x-spec-enum-id: c3b21f0be3baf815
          readOnly: true
        sender:
          allOf:
            - $ref: '#/components/schemas/MessageSender'
          nullable: true
          readOnly: true
          description: >-
            Who sent the message. Shape is one of the ``MessageSender`` variants
            in the schema; use top-level ``role`` to select it. ``null`` when
            ``role`` is ``system``, or for ``associate`` without ``author``.
        next_assignee:
          allOf:
            - $ref: '#/components/schemas/User'
          readOnly: true
          nullable: true
        next_action:
          enum:
            - ''
            - close_and_mark_resolved
            - close_and_mark_invalid
            - close_and_mark_customer_inactivity
            - reopen_waiting_customer
            - reopen_waiting_associate
            - close_and_mark_other
            - report_spam
            - remove_from_spam
          type: string
          description: >-
            * `` - (none)

            * `close_and_mark_resolved` - Close and Mark Resolved

            * `close_and_mark_invalid` - Close and Mark Invalid

            * `close_and_mark_customer_inactivity` - Close and Mark Customer
            Inactivity

            * `reopen_waiting_customer` - Reopen Waiting Customer

            * `reopen_waiting_associate` - Reopen Waiting Associate

            * `close_and_mark_other` - Close and Mark Other

            * `report_spam` - Report Spam

            * `remove_from_spam` - Remove from Spam
          x-spec-enum-id: 2881195d604caa00
        content:
          type: string
        content_html:
          type: string
        is_visible_to_customer:
          type: boolean
        external_recipient_emails:
          type: array
          items:
            type: string
            format: email
          nullable: true
          description: >-
            On create with CC email routing: for customer-visible messages, a
            list (empty or not) sets this message's external CC snapshot only;
            the ticket row is not updated. Omitted or null copies the last
            customer-visible message's snapshot, or the ticket's creation-time
            list if none. Internal messages (not visible to customer) always
            store an empty list; this field is ignored for them. The ticket
            requester is always kept when a list is sent. On read: snapshot
            stored on this message.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
          readOnly: true
      required:
        - attachments
        - author
        - created_at
        - id
        - next_assignee
        - role
        - sender
        - updated_at
    User:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        email:
          type: string
          format: email
          title: Email address
          maxLength: 254
        name:
          type: string
          title: Name of User
          maxLength: 255
      required:
        - email
        - id
    MessageSender:
      oneOf:
        - $ref: '#/components/schemas/AssociateMessageSender'
        - $ref: '#/components/schemas/CustomerMessageSender'
        - $ref: '#/components/schemas/CCMessageSender'
    Attachment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          nullable: true
          readOnly: true
        size:
          type: integer
          readOnly: true
          description: Attachment file size in bytes.
        download_url:
          type: string
          readOnly: true
      required:
        - download_url
        - id
        - name
        - size
    AssociateMessageSender:
      type: object
      description: Sender when ``Message.role`` is ``associate`` (inbox user).
      properties:
        email:
          type: string
          format: email
        name:
          type: string
        user_id:
          type: integer
      required:
        - email
        - name
        - user_id
    CustomerMessageSender:
      type: object
      description: Sender when ``Message.role`` is ``customer`` (ticket requester).
      properties:
        email:
          type: string
          format: email
        name:
          type: string
        customer_id:
          type: integer
      required:
        - customer_id
        - email
        - name
    CCMessageSender:
      type: object
      description: Sender when ``Message.role`` is ``cc`` (external participant).
      properties:
        email:
          type: string
          format: email
          nullable: true
        name:
          type: string
      required:
        - email
        - name
  securitySchemes:
    IntegrationToken:
      type: apiKey
      in: header
      name: X-Initdesk-Token

````