Get DM Media (XChat v3)
Fetch one XChat media attachment and return a playable URL. Use conversation_id, media_hash_key, and optional key_version from /v3/twitter/dm-history attachments.
Back to API Reference
/DM Endpoints
POST
/v3/twitter/dm-mediaAuthorization
AuthorizationBearer token · headerrequiredGlobal API Bearer Token for TwexAPI. Included as: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Request Body
requiredapplication/jsonconversation_idstringrequiredConversation id from /v3/twitter/dm-history
media_hash_keystringrequiredAttachment media_hash_key from dm-history
key_versionstring | anyOptional message key_version from dm-history (recommended).
Show propertiesHide properties
Any of:
string
stringany
anytype_namestring | anyOptional IMAGE/VIDEO/GIF hint
Show propertiesHide properties
Any of:
string
stringany
anyfilenamestring | anyOptional filename hint
Show propertiesHide properties
Any of:
string
stringany
anypinstring | anyIdentity PIN (default 1234).
default: "1234"
Show propertiesHide properties
Any of:
string
stringany
anycookiestringrequiredThe 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).
proxystring | anyOptional HTTP proxy. Example: http://username:password@ip:port
Show propertiesHide properties
Any of:
string
stringany
anyResponses
200Playable media URL and metadata.
codeintegerrequiredResponse code
msgstringrequiredResponse message
dataGetDmMediaV3Data | anyMedia info
Show propertiesHide properties
Any of:
GetDmMediaV3Data
urlstringrequiredPlayable media URL
pathstringrequiredMedia path on this API
content_typestringrequiredMIME type
filenamestring | anySuggested filename
Show propertiesHide properties
Any of:
string
stringany
anybyte_lengthintegerrequiredFile size in bytes
cachedbooleanrequiredWhether the media was already available
any
any422Validation Error
detailValidationError[]Show propertiesHide properties
Array of
ValidationErrorlocstring | integer[]requiredShow propertiesHide properties
Array of
string | integerAny of:
string
stringinteger
integermsgstringrequiredtypestringrequiredinputanyctxobject⚡Interactive ConsolePOST
⚡Interactive Console / Try APIPOSTLive Console
🌐Target Server:
https://api.twexapi.io● Production Ready
✍️
Write Operation Credentials Guide (TwexAPI Key + Twitter Cookie)
1. TwexAPI Platform Key (Bearer Token): Enter under "API Authorization" below for request billing & authentication.
2. Twitter Account Cookie: For write operations (tweet, like, follow, etc.), provide the target Twitter account's Cookie (e.g. auth_token=...; ct0=...) in the cookie field of Request Body below.
🔑API Authorization
📝Request Bodyapplication/json
📡
No Response Yet
Configure parameters in the Request tab and click Send Request below.
Request
curl -X POST "https://api.twexapi.io/v3/twitter/dm-media" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"conversation_id": "1928096185664843776:1989842918455291904",
"media_hash_key": "blRIlZCVIO",
"key_version": "3",
"type_name": "VIDEO",
"filename": "clip.mp4",
"pin": "1234",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
}'const response = await fetch("https://api.twexapi.io/v3/twitter/dm-media", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"conversation_id": "1928096185664843776:1989842918455291904",
"media_hash_key": "blRIlZCVIO",
"key_version": "3",
"type_name": "VIDEO",
"filename": "clip.mp4",
"pin": "1234",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
})
});import requests
response = requests.post(
"https://api.twexapi.io/v3/twitter/dm-media",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"conversation_id": "1928096185664843776:1989842918455291904",
"media_hash_key": "blRIlZCVIO",
"key_version": "3",
"type_name": "VIDEO",
"filename": "clip.mp4",
"pin": "1234",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
},
)Response
{
"code": 200,
"msg": "success",
"data": {
"url": "string",
"path": "string",
"content_type": "video/mp4",
"filename": "string",
"byte_length": 0,
"cached": true
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}