curl --request POST \
--url https://api.omnixapi.com/api/v1/twitter/dm/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auth_token": "YOUR_X_AUTH_TOKEN",
"text": "hello from the API",
"conversation_id": "1000000000000000001:2000000000000000002",
"user_id": "<string>",
"encryption_code": "YOUR_XCHAT_PIN",
"proxy": "http://user:pass@host:8080"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auth_token: 'YOUR_X_AUTH_TOKEN',
text: 'hello from the API',
conversation_id: '1000000000000000001:2000000000000000002',
user_id: '<string>',
encryption_code: 'YOUR_XCHAT_PIN',
proxy: 'http://user:pass@host:8080'
})
};
fetch('https://api.omnixapi.com/api/v1/twitter/dm/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.omnixapi.com/api/v1/twitter/dm/send"
payload = {
"auth_token": "YOUR_X_AUTH_TOKEN",
"text": "hello from the API",
"conversation_id": "1000000000000000001:2000000000000000002",
"user_id": "<string>",
"encryption_code": "YOUR_XCHAT_PIN",
"proxy": "http://user:pass@host:8080"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": true,
"data": {
"ok": true,
"message_id": "<string>",
"conversation_id": "<string>",
"sender_id": "<string>",
"text": "<string>",
"encrypted": true
},
"error": null
}{
"status": false,
"data": null,
"error": "Missing required field: text"
}{
"status": false,
"data": null,
"error": "You can only delete your own tweets"
}Send Message
Send a direct message. Target an existing conversation_id or a user_id (starts/reuses a 1-on-1). When encryption_code (your XChat PIN — the code you set when enabling encrypted chats on X) is supplied with a conversation_id, the message is sent end-to-end encrypted (so it can later be deleted for everyone); otherwise it uses X’s reliable legacy path (delete-for-self only).
curl --request POST \
--url https://api.omnixapi.com/api/v1/twitter/dm/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auth_token": "YOUR_X_AUTH_TOKEN",
"text": "hello from the API",
"conversation_id": "1000000000000000001:2000000000000000002",
"user_id": "<string>",
"encryption_code": "YOUR_XCHAT_PIN",
"proxy": "http://user:pass@host:8080"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auth_token: 'YOUR_X_AUTH_TOKEN',
text: 'hello from the API',
conversation_id: '1000000000000000001:2000000000000000002',
user_id: '<string>',
encryption_code: 'YOUR_XCHAT_PIN',
proxy: 'http://user:pass@host:8080'
})
};
fetch('https://api.omnixapi.com/api/v1/twitter/dm/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.omnixapi.com/api/v1/twitter/dm/send"
payload = {
"auth_token": "YOUR_X_AUTH_TOKEN",
"text": "hello from the API",
"conversation_id": "1000000000000000001:2000000000000000002",
"user_id": "<string>",
"encryption_code": "YOUR_XCHAT_PIN",
"proxy": "http://user:pass@host:8080"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": true,
"data": {
"ok": true,
"message_id": "<string>",
"conversation_id": "<string>",
"sender_id": "<string>",
"text": "<string>",
"encrypted": true
},
"error": null
}{
"status": false,
"data": null,
"error": "Missing required field: text"
}{
"status": false,
"data": null,
"error": "You can only delete your own tweets"
}Authorizations
Your OmniX API key, e.g. omnix_live_.... Billed per call.
Body
The X account auth_token cookie the action runs as.
"YOUR_X_AUTH_TOKEN"
The message text.
"hello from the API"
An existing conversation (from the inbox). Provide this or user_id.
"1000000000000000001:2000000000000000002"
A numeric user id to start/reuse a 1-on-1. Provide this or conversation_id.
Your XChat encryption code — the PIN you set when enabling encrypted chats on X. Used to recover your key so messages can be decrypted and outgoing events signed.
"YOUR_XCHAT_PIN"
Optional outbound proxy for this call (http:// or https://, optionally user:pass@host:port). The X request runs through it — useful for geo-routing or spreading calls across IPs. SOCKS proxies are not supported.
"http://user:pass@host:8080"