I’m using self-hosted n8n and trying to upload media while creating a post on X (Twitter) using the Free X API v2. However, I’m unable to get it working.
What I’ve tried:
- Using the HTTP Request node to send a
POST request to upload media before posting. URL : ```
https://api.twitter.com/2/media/upload
2. Confirmed that my X API key and authentication settings are correct.
3. Attempted to use different endpoints, but media is not being attached to the post.
4. Checked X API documentation—seems like media upload might have restrictions in the Free tier.

Could you share a Snippet of the HTTP Request you’re making?
The main item that comes to mind after reading the documentation (POST media/upload | Docs | Twitter Developer Platform) is:
- Checking the way the Media is being send through
multipart/form-data or application/x-www-form-urlencoded, either as binary or base64`
Could you also share the error you’re receiving when trying to do the request?
I believe this post might be of use to you as it goes straight through the process of uploading media to X. Only downside is that it is in French but visible the steps should be clear
Minute 5.45 (Sets up the OAuth) up until Minute 10.25 where he finishes uploading the image
Hopefully this helps 
while using this method it show error on connecting X oauth api
This method will be deprecated
“v1.1 media upload endpoint will be deprecated on March 31, 2025”
please check this:
http://community.n8n.io/t/solved-post-media-to-x-twitter-via-api/90997
If my reply answers your question, please remember to mark it as a solution.