# Twitter Node using API V2

**URL:** <https://community.n8n.io/t/twitter-node-using-api-v2/26139>\
**Category:** Questions\
**Tags:** credentials, node\
**Created:** [May 12, 2023, 10:48am UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139 "2023-05-12T10:48:49Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rad](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rad/32/25328_2.png) [@Rad](https://community.n8n.io/u/Rad)\
**Post date:** [May 12, 2023, 10:48am UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/1 "2023-05-12T10:48:49Z")

</div>

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

```auto
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: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve
Stack
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 ?

Rad

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [May 12, 2023, 11:35am UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/2 "2023-05-12T11:35:34Z")

</div>

Hey @Rad,

Welcome to the community 🍰

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](https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve)

---

<div class="post-metadata">

**Author:** ![Rad](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rad/32/25328_2.png) [@Rad](https://community.n8n.io/u/Rad)\
**Post date:** [May 12, 2023, 12:07pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/3 "2023-05-12T12:07:38Z")

</div>

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

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/9/5/9511a91c5c78f495f6fed0c63647644cf9f42765.png)

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

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [May 12, 2023, 12:13pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/4 "2023-05-12T12:13:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rad](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rad/32/25328_2.png) [@Rad](https://community.n8n.io/u/Rad)\
**Post date:** [May 12, 2023, 12:37pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/5 "2023-05-12T12:37:34Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [May 12, 2023, 12:42pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/6 "2023-05-12T12:42:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sistemes](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sistemes/32/13356_2.png) [@sistemes](https://community.n8n.io/u/sistemes)\
**Post date:** [June 1, 2023, 1:45pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/7 "2023-06-01T13:45:54Z")

</div>

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

We will wait for the update

Thanks you!!

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [June 1, 2023, 2:11pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/8 "2023-06-01T14:11:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rad](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rad/32/25328_2.png) [@Rad](https://community.n8n.io/u/Rad)\
**Post date:** [June 2, 2023, 1:51am UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/9 "2023-06-02T01:51:35Z")

</div>

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.  
Rad

---

<div class="post-metadata">

**Author:** ![sistemes](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sistemes/32/13356_2.png) [@sistemes](https://community.n8n.io/u/sistemes)\
**Post date:** [June 2, 2023, 12:06pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/10 "2023-06-02T12:06:17Z")

</div>

Hi @Rad,

Can you share the code?

Thanks you!

---

<div class="post-metadata">

**Author:** ![Zaphod](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/zaphod/32/6856_2.png) [@Zaphod](https://community.n8n.io/u/Zaphod)\
**Post date:** [June 7, 2023, 5:31pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/11 "2023-06-07T17:31:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rad](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rad/32/25328_2.png) [@Rad](https://community.n8n.io/u/Rad)\
**Post date:** [June 12, 2023, 8:27am UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/12 "2023-06-12T08:27:23Z")

</div>

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  
URL : [https://api.twitter.com/2/tweets](https://api.twitter.com/2/tweets)  
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

Rad

---

<div class="post-metadata">

**Author:** ![Mec](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mec/32/25790_2.png) [@Mec](https://community.n8n.io/u/Mec)\
**Post date:** [June 13, 2023, 1:09pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/13 "2023-06-13T13:09:55Z")

</div>

> [@Rad](#):
>
> TEXT

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

---

<div class="post-metadata">

**Author:** ![sistemes](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sistemes/32/13356_2.png) [@sistemes](https://community.n8n.io/u/sistemes)\
**Post date:** [June 14, 2023, 6:02am UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/14 "2023-06-14T06:02:43Z")

</div>

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”:

```auto
{"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  
Regards

---

<div class="post-metadata">

**Author:** ![RCS](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rcs/32/26285_2.png) [@RCS](https://community.n8n.io/u/RCS)\
**Post date:** [June 15, 2023, 10:58am UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/15 "2023-06-15T10:58:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MatthewSabia](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/matthewsabia/32/27402_2.png) [@MatthewSabia](https://community.n8n.io/u/MatthewSabia)\
**Post date:** [June 15, 2023, 4:50pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/16 "2023-06-15T16:50:09Z")

</div>

Really looking forward to this! Any rough ETA?

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [June 15, 2023, 9:20pm UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/17 "2023-06-15T21:20:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hakka168](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/hakka168/32/26416_2.png) [@hakka168](https://community.n8n.io/u/hakka168)\
**Post date:** [June 19, 2023, 5:38am UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/18 "2023-06-19T05:38:57Z")

</div>

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](https://api.twitter.com/2/problems/oauth1-permissions)”}

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/36532_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [September 17, 2023, 5:39am UTC](https://community.n8n.io/t/twitter-node-using-api-v2/26139/19 "2023-09-17T05:39:31Z")

</div>

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