---
title: "Send DM (XChat v3)"
method: POST
path: "/v3/twitter/send-dm"
tags: ["DM Endpoints"]
---

# Send DM (XChat v3)

`POST /v3/twitter/send-dm`

## Request

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

Send DM via XChat encrypted chat API (1:1 or existing group g...), optional image via media_urls (max 1) or video via video_url (mutually exclusive). $0.0005 per call.

## Request body

- SendDmV3Query: Parameters for sending DM via XChat v3
  - `recipient` string, required: User id, @handle, or a group id (g...) for an existing group.
  - `text` string, required: Message body.
  - `media_urls` string[], nullable: Public URL of one image to attach (max 1). Mutually exclusive with video_url.
  - `video_url` string, nullable: Public http(s) URL of one video to attach (mutually exclusive with image).
  - `pin` string, nullable: Identity PIN (default 1234).
  - `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`

A message object.

- SendDmResponse: Response for sending DM
  - `code` integer, required: Response code
  - `msg` string, required: Message sent
  - `data` MessageModel, required: Message model
    - `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)
