Twitter Node using API V2

Hi everyone
I have an issue with Twitter API V2.
First of all the documentation is a bit outdated, I think Twitter has made some new changes in their developer portal
Also I still have many problems using a simple node of twitter
After credential setup, I am not able to test even with a simple tweet creation.
My error message is

You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here:
NodeApiError: Forbidden - perhaps check your credentials?
    at Object.twitterApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Twitter/GenericFunctions.js:26:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Twitter/Twitter.node.js:153:40)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:652:28)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:592:53

Could this be a bug due to some twitter API changes ?


Hey @Rad,

Welcome to the community :cake:

The node is a bit outdated and we are aware that it needs an update but looking at the message you are getting back from Twitter you would need the Elevated access to use the node.

You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: Getting Started with the Twitter API | Docs | Twitter Developer Platform

Thank you @Jon

But according to the Twitter developer portal with the API free tier we are supposed to be ale to post up to thousand tweets per month

I think the error message is generic though, the free tier still enables posting or creating tweets, no ?

Hey @Rad,

The free tier does but we don’t support the v2 endpoints at the moment we use v1.1 which requires Elevated Access.

Hey @Jon !
Aouch I see, ok it makes sense
Any plan to support v2 soon ? Elevated access jumps straight to 40$/months, which is a bit too much for my use case.
Any other alternative you can suggest to bypass this node in order to post tweets. The mode itself come in the middle of a larger workflow, any clever bypassing alternative will be more than welcome :slight_smile:

Hey @Rad,

We do plan to update the node but we also want to introduce PKCE support at the same time which is a fairly large change and may involve swapping out the oauth package we use which will need a lot of testing.

As a workaround you could try using the HTTP Request node to send to the v2 api but I have not tried this yet.

I’m getting the same error response from Twitter API.

We will wait for the update

Thanks you!!

1 Like

Shouldn’t be that far out, It is being worked on now.

Hi @sistemes
As suggested by @Jon You can use the HTTP request node to achieve the same goal, I am using this with no issues at all.

1 Like

Hi @Rad,

Can you share the code?

Thanks you!

1 Like

I’m having the same issues. Would also be very interested in your code, @Rad, as a workaround!

Hi guys,
Sorry for the delay
So yes, all you have to do is the following:

1- Grad an HTTP Request node
2- Use the following details:

Method : POST
Authentication : Predefined Credential Type
Credential Type : Twitter OAuth API
Credential : You have to set this one following the Docs on Twitter side : basically go to Twitter Developer, Create an account, generate Keys and link them here
Toggle “Send body”
Body Content Type : Json
Specify Body : Using Fields Below
Body Parameters : TEXT , Value : Whatever you feed that node (this will be your tweet text)

This is how I use it on my end and it is working very well for me

I hope this helps


1 Like

thanks for this.
small update. Body parameters should be text with small letters instead if TEXT which gives error

1 Like

Hi all,

Thanks you @Rad for the tip!

I’m still getting an error. I recreated the keys (even deleting the app in Twitter and generating new keys), and linked the keys, but still getting ang “401 error”:

{"status":"rejected","reason":{"message":"Authorization failed - please check your credentials","timestamp":1686721951975,"name":"NodeApiError","description":"{\n  \"title\": \"Unauthorized\",\n  \"type\": \"about:blank\",\n  \"status\": 401,\n  \"detail\": \"Unauthorized\"\n}","context":{},"cause":{"message":"401 - \"{\\n  \\\"title\\\": \\\"Unauthorized\\\",\\n  \\\"type\\\": \\\"about:blank\\\",\\n  \\\"status\\\": 401,\\n  \\\"detail\\\": \\\"Unauthorized\\\"\\n}\"","name":"Error","stack":"Error: 401 - \"{\\n  \\\"title\\\": \\\"Unauthorized\\\",\\n  \\\"type\\\": \\\"about:blank\\\",\\n  \\\"status\\\": 401,\\n  \\\"detail\\\": \\\"Unauthorized\\\"\\n}\"\n    at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n    at RedirectableRequest.handleResponse (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:238:9)\n    at RedirectableRequest.emit (node:events:525:35)\n    at RedirectableRequest.emit (node:domain:489:12)\n    at RedirectableRequest._processResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:356:10)\n    at ClientRequest.RedirectableRequest._onNativeResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:62:10)\n    at Object.onceWrapper (node:events:628:26)\n    at ClientRequest.emit (node:events:525:35)\n    at ClientRequest.emit (node:domain:489:12)\n    at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)\n    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)\n    at TLSSocket.socketOnData (node:_http_client:534:22)\n    at TLSSocket.emit (node:events:513:28)\n    at TLSSocket.emit (node:domain:489:12)\n    at addChunk (node:internal/streams/readable:315:12)\n    at readableAddChunk (node:internal/streams/readable:289:9)\n    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)\n    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)"}}}

Thanks you

So it does work I did it myself this morning.
You need to use the API keys same as the twitter node used to take.

Really looking forward to this! Any rough ETA?

I would say a few weeks, depends on when it is reviewed and if we find any issues.


Hi Rad,
Thanks for your share. I did it as you mentioned above. The twitter connected already. But it has following problem, could you help how solve this problem? Many thanks!
ERROR: Forbidden - perhaps check your credentials?
{“title”:“Forbidden”,“status”:403,“detail”:“Your client app is not configured with the appropriate oauth1 app permissions for this endpoint.”,“type”:“Twitter API Response Codes & Error Support | Twitter Developer Platform”}


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