---
title: "Get DM conversation history"
method: GET
path: "/x/dm/{userId}/history"
tags: ["Users"]
---

# Get DM conversation history

`GET /x/dm/{userId}/history`

## Path parameters

- `userId` string, required

## Query parameters

- `account` string, required
- `cursor` string
- `maxId` string

## Response `200`

List of DM messages

- object
  - `messages` object[], required
    - `id` string, required
    - `text` string
    - `senderId` string, required
    - `receiverId` string, required
    - `createdAt` string
    - `mediaUrl` string — URL of attached media (image, GIF, or video). Omitted when the message has no media attachment.
  - `has_next_page` boolean, required
  - `next_cursor` string, required

## Other responses

- `400` — Invalid input. Either `invalid_user_id` (path user ID is empty or invalid) or `account_required` (the `account` query parameter was missing or empty).
- `401` — Unauthenticated
- `402` — Payment required. Fixed-price direct MPP requests return a Machine Payments Protocol problem document and a WWW-Authenticate challenge. Authenticated X data requests return balances and explicit Stripe checkout-creation actions. Guest paid-read keys receive only the accountless guest top-up action. Direct MPP challenges also advertise the Stripe wallet action. Other authenticated endpoints return a legacy error shape. A failed request never creates checkout. Create checkout only after the user confirms a payment option.
- `403` — DM read forbidden. Either the connected account is not a participant in this conversation (`dm_not_permitted`), the account is suspended, locked, or otherwise restricted (`account_restricted`), or the account session needs to be re-authenticated (`account_needs_reauth`).
- `404` — Connected X account not found for the authenticated user.
- `424` — Dependency unavailable, unauthorized, or rate limited. Default v1 returns 502. The best-practice response contract returns 424 for transparent dependency failures.
- `429` — Xquik tier rate limit exceeded. The response includes a `Retry-After` header with the number of seconds to wait before retrying.
- `502` — Dependency unavailable, unauthorized, or rate limited. Default v1 returns 502. The best-practice response contract returns 424 for transparent dependency failures.

---

[API](https://skmtc.net/xquik-dev/apis/xquik-api-3.md) · [All operations](https://skmtc.net/xquik-dev/apis/xquik-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xquik-dev/xquik-api-3/revisions/00d8449a6cc1/schema)
