---
title: "Get session messages"
method: GET
path: "/api/sessions/{sessionId}/messages"
tags: ["Sessions"]
---

# Get session messages

`GET /api/sessions/{sessionId}/messages`

## Request

- Base URL: `https://aximo.autify.com`
- URL: `https://aximo.autify.com/api/sessions/{sessionId}/messages`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/autify/apis/aximo-api/docs/api/sessions/:sessionId/messages/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns the message timeline (tool calls, assistant text, user input) for a
session. Cursor-paginated; pass `nextCursor` to fetch subsequent pages.

## Path parameters

- `sessionId` string, uuid, required

## Query parameters

- `cursor` string
- `limit` integer
- `order` 'asc' | 'desc'

## Response `200`

Paginated messages.

- SessionMessagesPage
  - `items` SessionMessage[], required
    - `id` string, uuid, required
    - `role` string, required: One of `user`, `assistant`, `system`, `tool`.
    - `content` string, required
    - `metadata` object, nullable: Tool-call metadata when `role` is `tool` or `assistant`. Common keys: `toolName`, `toolInput`, `toolOutput`, `toolCallId`, `toolCalls`. On the first `user` message, `rewritten: true` indicates `content` is the AI-normalized form of the user's prompt (restructured into ordered steps); `originalPrompt` then holds the user's exact text. User messages rejected by safety review carry `rejected`, `verdict`, and `rejectionReason`.
    - `createdAt` string, date-time, required
  - `nextCursor` string, nullable: Pass as `cursor` on the next request. `null` when no more pages.

## Other responses

- `400`: Invalid query parameters.
- `401`: Missing or invalid API key.
- `404`: Session not found.
- `429`: Rate limit exceeded — e.g. the daily session limit was reached for the organization, or too many API requests were sent in a short window (retry after the number of seconds in the `Retry-After` header).
- `500`: Unexpected server error.

---

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