Skip to main content
POST
/
x
/
dm
/
{id}
Send direct message
curl --request POST \
  --url https://api.example.com/x/dm/{id} \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "account": "<string>",
  "text": "<string>",
  "media_ids": [
    "<string>"
  ],
  "reply_to_message_id": "<string>"
}
'
10 credits per call · All plans from $0.00012/credit
curl -X POST https://xquik.com/api/v1/x/dm/44196397 \
  -H "x-api-key: xq_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "myxaccount",
    "text": "Hello from Xquik!"
  }' | jq

Headers

x-api-key
string
required
Your API key. Session cookie authentication is also supported. Generate a key from the dashboard.
Content-Type
string
required
Must be application/json.

Path parameters

id
string
required
The X user ID of the recipient.

Body

account
string
required
X username or account ID of your connected account to act as.
text
string
required
Message text to send. Maximum 10,000 characters.
media_ids
string[]
Array of media IDs to attach. Upload media first via the X media upload endpoint.
reply_to_message_id
string
ID of a previous message to reply to within the conversation.

Response

messageId
string
The ID of the sent message.
success
boolean
Always true on success.
{
  "messageId": "1893726451029384192",
  "success": true
}
Related: Get User to look up a user’s ID before messaging, or Follow User to follow the recipient.