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

# List session messages

> List all messages for a session with cursor-based pagination, ordered chronologically.

<Note>
  The `devin_id` is the session ID prefixed with `devin-` (e.g., `devin-abc123`).
</Note>

## Permissions

Requires a service user with the `ViewAccountSessions` permission at the enterprise level.


## OpenAPI

````yaml /v3-openapi.yaml GET /v3/enterprise/sessions/{devin_id}/messages
openapi: 3.1.0
info:
  description: Devin v3 API with Service User authentication and RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/enterprise/sessions/{devin_id}/messages:
    get:
      tags:
        - sessions
      summary: List session messages
      description: >-
        List all messages for a session with cursor-based pagination, ordered
        chronologically.
      operationId: >-
        handle_get_account_session_messages_v3_enterprise_sessions__devin_id__messages_get
      parameters:
        - description: 'Devin session ID (prefix: devin-)'
          in: path
          name: devin_id
          required: true
          schema:
            anyOf:
              - type: string
              - type: 'null'
            example: devin-abc123def456
            title: Devin Id
        - in: query
          name: qs
          required: true
          schema:
            $ref: '#/components/schemas/CursorPaginationParams'
        - in: query
          name: org_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Org Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_SessionMessage_'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    CursorPaginationParams:
      properties:
        after:
          anyOf:
            - type: string
            - type: 'null'
          title: After
        first:
          default: 100
          maximum: 200
          minimum: 1
          title: First
          type: integer
      title: CursorPaginationParams
      type: object
    PaginatedResponse_SessionMessage_:
      properties:
        end_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: Cursor to fetch the next page, or None if this is the last page.
          title: End Cursor
        has_next_page:
          default: false
          description: Whether there are more items available after this page.
          title: Has Next Page
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/SessionMessage'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: Optional total count (can be omitted for performance).
          title: Total
      required:
        - items
      title: PaginatedResponse[SessionMessage]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SessionMessage:
      description: A message in a Devin session.
      properties:
        created_at:
          title: Created At
          type: integer
        event_id:
          title: Event Id
          type: string
        message:
          title: Message
          type: string
        source:
          enum:
            - devin
            - user
          title: Source
          type: string
      required:
        - event_id
        - source
        - message
        - created_at
      title: SessionMessage
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Service User credential (prefix: cog_)'
      scheme: bearer
      type: http

````