---
title: "Get DM History (XChat v3)"
method: POST
path: "/v3/twitter/dm-history"
tags: ["DM Endpoints"]
---

# Get DM History (XChat v3)

`POST /v3/twitter/dm-history`

## Request

- Base URL: `https://api.twexapi.io`
- URL: `https://api.twexapi.io/v3/twitter/dm-history`
- Auth: HTTP bearer

Get DM history via XChat encrypted chat API. Use count for page size (10–200). Set all=true to follow has_more and return every page. Or paginate manually: when has_more is true, pass the oldest message's sequence_id as before.

## Request body

- GetDmHistoryV3Query: Parameters for getting DM history via XChat v3
  - `recipient` string, required: User id, @handle, conversationId a:b, or group g....
  - `pin` string, nullable: Identity PIN (default 1234).
  - `count` integer, nullable: Max events per page (10–200, default 50).
  - `all` boolean, nullable: Follow has_more and return every page.
  - `before` string, nullable: Oldest sequenceId for paging. Pass the previous page's oldest message sequence_id.
  - `cookie` string, required: The user's own authorized Twitter session credentials or auth_token (BYOC — Bring Your Own Cookie). Stateless proxy execution with zero credential retention. See [Authentication Security](/authentication#write-operations--byoc-bring-your-own-cookie) and [How to get Cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie).
  - `proxy` string, nullable: Optional HTTP proxy. Example: http://username:password@ip:port

## Response `200`

Conversation messages with pagination info.

- GetDmHistoryV3Response: Response for getting DM history via XChat v3
  - `code` integer, required: Response code
  - `msg` string, required: Response message
  - `data` DmHistoryV3Data: DM history payload for XChat v3
    - `conversation_id` string, required: Conversation id
    - `has_more` boolean, required: Whether older messages are available
    - `messages` MessageModel[], required: List of message objects
      - `id` string, required: Message ID
      - `text` string, required: Message text
      - `time` string, required: Message time
      - `attachment` object, nullable: Message attachment
      - `attachments` object[], nullable: XChat media attachments (v3).
      - `sequence_id` string, nullable: XChat sequence id. Use the oldest message's sequence_id as before for pagination.
      - `sender_id` string, nullable: Sender ID
      - `recipient_id` string, nullable: Recipient ID

## Other responses

- `422`: Validation Error

---

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