DM Endpoints

Send DM (XChat v3)

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.

post/v3/twitter/send-dm

Request

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

Request body

recipientstring required

User id, @handle, or a group id (g...) for an existing group.

textstring required

Message body.

media_urlsstring[] nullable

Public URL of one image to attach (max 1). Mutually exclusive with video_url.

video_urlstring nullable

Public http(s) URL of one video to attach (mutually exclusive with image).

pinstring nullable

Identity PIN (default 1234).

cookiestring 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 and How to get Cookie.

proxystring nullable

Optional HTTP proxy. Example: http://username:password@ip:port

Example request

{
  "recipient": "baker_donn80196",
  "text": "hello from docs",
  "media_urls": [
    "https://example.com/image.jpg"
  ],
  "video_url": "https://video.twimg.com/amplify_video/2077160248830275584/vid/avc1/320x568/kwNDLTm",
  "pin": "1234",
  "cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
  "proxy": "http://username:password@ip:port"
}

Response

A message object.

codeinteger required

Response code

msgstring required

Message sent

Example response

{
  "code": 200,
  "msg": "success",
  "data": {
    "id": "1234567890123456789",
    "text": "Hello, how are you?",
    "time": "2024-01-01T12:00:00Z",
    "attachment": {
      "type": "image",
      "url": "https://example.com/image.jpg"
    },
    "attachments": [
      {
        "attachment_id": "cda5ccdd-af53-48a3-bdd1-5039a73aea25",
        "conversation_id": "1928096185664843776:1989842918455291904",
        "filename": "image.jpg",
        "filesize_bytes": 421299,
        "height": 1448,
        "key_version": "3",
        "media_hash_key": "blRIlZCVIO",
        "type": "image",
        "type_name": "IMAGE",
        "width": 1086
      }
    ],
    "sequence_id": "2076661179334979585",
    "sender_id": "1234567890123456789",
    "recipient_id": "1234567890123456789"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.