---
title: "Get Session Messages"
method: GET
path: "/api/v1/sessions/{session_id}/messages"
tags: ["sessions"]
---

# Get Session Messages

`GET /api/v1/sessions/{session_id}/messages`

## Request

- Base URL: `https://api.gnosari.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gnosari.com/api/v1/sessions/{session_id}/messages`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-AUTH-TOKEN`

Get messages for a session with pagination.

Use this endpoint when you need complete message history without
loading the full session object.

Supports three access levels based on session's agent/team:
- PUBLIC: No authentication required
- PASSWORD_PROTECTED: X-Access-Password header required
- PRIVATE: User authentication required

Args:
    limit: Maximum messages to return (default 100)
    skip: Number of messages to skip for pagination
    order: Sort order - 'asc' (oldest first) or 'desc' (newest first)
    paginated: If True, returns SessionMessagesResponse with total_count and has_more

## Path parameters

- `session_id` string, required

## Query parameters

- `limit` integer: Maximum messages to return
- `skip` integer: Number of messages to skip for pagination
- `order` 'asc' | 'desc': Sort order - 'asc' (oldest first) or 'desc' (newest first)
- `paginated` boolean: Return paginated response with total_count and has_more

## Headers

- `X-Access-Password` string, nullable

## Response `200`

Successful Response

- union
  - SessionMessagesResponse: Response for dedicated messages endpoint. Use get_session_messages endpoint to retrieve paginated messages without loading the full session object.
    - `session_id` string, required
    - `messages` SessionMessage[]
      - `message_data` string, required
      - `id` integer, required
      - `session_id` string, required
      - `created_at` string, date-time, required
      - `updated_at` string, date-time, required
      - `attachments` MessageAttachmentRef[]: Attachment references parsed from message_data content parts (Phase 7). Empty for text-only messages.
        - `asset_id` string, required
        - `kind` string, required: asset.kind vocabulary: image | document
        - `filename` string, nullable
    - `total_count` integer, required
    - `has_more` boolean, required
  - SessionMessage[]
    - `message_data` string, required
    - `id` integer, required
    - `session_id` string, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `attachments` MessageAttachmentRef[]: Attachment references parsed from message_data content parts (Phase 7). Empty for text-only messages.
      - `asset_id` string, required
      - `kind` string, required: asset.kind vocabulary: image | document
      - `filename` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/gnosari/apis/gnosari-api.md) · [All operations](https://skmtc.dev/gnosari/apis/gnosari-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gnosari/apis/gnosari-api/revisions/f299cf53ae5f?raw)
