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

# Get User Messages

> Get recent conversation messages across all user sessions.

Retrieve the most recent N messages for a user from across all their sessions, sorted chronologically.
Useful for displaying conversation history or providing chat context.

**Path Parameters:**
- `custom_user_id` (str): Unique identifier for the user

**Query Parameters:**
- `limit` (int): Number of recent messages to retrieve. Range: 1-100. Default: 10

**Returns:**
- `messages` (List[UserMessage]): List of message objects with role, content, timestamp, and session_id



## OpenAPI

````yaml https://api.recallrai.com/api/openapi.json get /api/v1/users/{custom_user_id}/messages
openapi: 3.1.0
info:
  title: api-backend
  description: This powers the Recallr AI API Backend
  version: 0.1.0
servers:
  - url: https://api.recallrai.com
    description: Production server
security: []
paths:
  /api/v1/users/{custom_user_id}/messages:
    get:
      tags:
        - Users
      summary: Get User Messages
      description: >-
        Get recent conversation messages across all user sessions.


        Retrieve the most recent N messages for a user from across all their
        sessions, sorted chronologically.

        Useful for displaying conversation history or providing chat context.


        **Path Parameters:**

        - `custom_user_id` (str): Unique identifier for the user


        **Query Parameters:**

        - `limit` (int): Number of recent messages to retrieve. Range: 1-100.
        Default: 10


        **Returns:**

        - `messages` (List[UserMessage]): List of message objects with role,
        content, timestamp, and session_id
      operationId: get_user_messages_api_v1_users__custom_user_id__messages_get
      parameters:
        - name: custom_user_id
          in: path
          required: true
          schema:
            type: string
            title: The ID of the user to get messages for
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            title: Number of recent messages to retrieve
            default: 10
        - name: X-Recallr-Project-Id
          in: header
          required: true
          schema:
            type: string
            format: uuid
            title: X-Recallr-Project-Id
        - name: X-Recallr-Api-Key
          in: header
          required: true
          schema:
            type: string
            title: X-Recallr-Api-Key
      responses:
        '200':
          description: User messages retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserMessagesResponse'
        '401':
          description: Authentication required
        '404':
          description: User not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
components:
  schemas:
    GetUserMessagesResponse:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/UserMessage'
          type: array
          title: Messages
      type: object
      required:
        - messages
      title: GetUserMessagesResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserMessage:
      properties:
        role:
          type: string
          title: Role
        content:
          type: string
          title: Content
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        session_id:
          type: string
          title: Session Id
      type: object
      required:
        - role
        - content
        - timestamp
        - session_id
      title: UserMessage
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````