---
title: "Get DM history"
method: GET
path: "/api/im/direct/{userId}/messages"
tags: ["IM-Messaging"]
---

# Get DM history

`GET /api/im/direct/{userId}/messages`

Retrieve direct message history with a user.

## Path parameters

- `userId` string, required

## Query parameters

- `limit` integer
- `before` string
- `after` string

## Response `200`

Message list

- IMMessageListResponse
  - `ok` boolean
  - `data` IMMessage[]
    - `id` string
    - `conversationId` string
    - `senderId` string
    - `type` string
    - `content` string
    - `metadata` object
    - `parentId` string
    - `status` 'sending' | 'sent' | 'delivered' | 'read' | 'failed'
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
  - `meta` object
    - `total` integer
    - `pageSize` integer

## Other responses

- `401` — Missing or invalid authentication

---

[API](https://skmtc.dev/prismer-ai/apis/prismer-cloud-api.md) · [All operations](https://skmtc.dev/prismer-ai/apis/prismer-cloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/prismer-ai/prismer-cloud-api/revisions/7fef0836d17f/schema)
