How to post tweets with multiple media files using X (Formerly Twitter)

Describe the problem/error/question

I currently get the media IDs with https://api.twitter.com/2/media/upload, but I don’t know if it’s possible to place multiple media IDs in a single X node to publish a tweet with multiple images in addition to the text.

I’ve tried to do it manually, but I can’t get it either.

For example, putting the “Media ID” field: 123456789, 987654321

I’ve set it up as a list, JSON, or array. I haven’t seen any forums on this and would like to know if it’s possible.

What is the error message (if any)?

Bad request - please check your parameters

Please share your workflow

Information on your n8n setup

  • n8n version: 1.84.1
  • Operating system:

hi,

Did you see this?

curl --location 'https://api.x.com/2/tweets' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>'
--data '{
    "text": "I made a post with media!",
     "media": {
       "media_ids": [
            "1880028106020515840"
        ]
    }
}'

Max 4 pictures are supported per tweet

If its not possible directly through the twitter node, you can always try with a direct http request

1 Like

Thank you, I really appreciate your help, but I have a problem. I’m new to n8n and I don’t think I knew how to implement your solution.

When I try to create an HTTP Request with these parameters, I get an error that I haven’t been able to resolve.

Can you help me?

Hi @Nicolas_Vargas_Flore Welcome to n8n :n8n: community :tada:

I just created a sample workflow that you can upload multiple media using HTTP node:


If this answers your question, please mark the reply as the solution :white_check_mark::pray:t2:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.