Skip to main content
POST
/
x
/
media
Upload media
curl --request POST \
  --url https://api.example.com/x/media \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "account": "<string>",
  "file": {},
  "url": "<string>",
  "is_long_video": true
}
'
10 credits per call · All plans from $0.00012/credit
curl -X POST https://xquik.com/api/v1/x/media \
  -H "x-api-key: xq_YOUR_KEY_HERE" \
  -F "account=myxhandle" \
  -F "file=@/path/to/image.png" | jq
URL-based upload (for AI agents and MCP clients):
curl -X POST https://xquik.com/api/v1/x/media \
  -H "x-api-key: xq_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"account": "myxhandle", "url": "https://example.com/image.png"}' | 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
Use multipart/form-data when uploading a file. Use application/json when providing a URL.

Body

account
string
required
The connected X account to upload media as. Must be a username you have connected to your Xquik account.
file
binary
The media file to upload. Required if url is not provided. Supported formats: GIF, JPEG, PNG, MP4.
url
string
HTTPS URL to download media from. Required if file is not provided. The server fetches the file from this URL. Useful for AI agents and MCP clients that work with URLs instead of binary file uploads.
is_long_video
boolean
Set to true for videos longer than 140 seconds. Defaults to false.

Response

mediaId
string
The uploaded media ID. Use this in the media_ids array when creating tweets.
success
boolean
Always true on success.
{
  "mediaId": "1893726451023847424",
  "success": true
}
10 credits per call · All plans from $0.00012/credit
Use the returned mediaId in the media_ids array when creating a tweet. Media IDs are valid for 24 hours after upload.
Related endpoints: Create Tweet to post a tweet with uploaded media, Create Community to create a new community.