X (formerly Twitter) predefined and generic credentials scopes

Describe the problem/error/question

I noticed something awkward. It seems that the predefined X OAuth2 API credentials have only 14 scopes available:
tweet.read
users.read
tweet.write
tweet.moderate.write
users.read
follows.read
follows.write
offline.access
like.read
like.write
dm.write
dm.read
list.read
list.write

However, I need the media.write scope to upload images/videos.

I tried to set up a generic OAuth2 API credential type with both media.write and tweet.write (+offline.access), but they don’t seem to work combined, and I always get an error like “Forbidden - perhaps check your credentials?” or “The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.”

So that made me set up two OAuth2 credentials, one for each scope.
However, everytime I have to run the workflow I have to reconnect both credentials. I guess it’s because of the refresh token flow.

Anyone else have the same problem?

What is the error message (if any)?

Forbidden - perhaps check your credentials

{
“errorMessage”: “Forbidden - perhaps check your credentials?”,
“errorDescription”: “Forbidden”,
“errorDetails”: {
“rawErrorMessage”: [
“403 - "{\n \"title\": \"Forbidden\",\n \"type\": \"about:blank\",\n \"status\": 403,\n \"detail\": \"Forbidden\"\n}"”
],
“httpCode”: “403”
},
“n8nDetails”: {
“nodeName”: “Post to X”,
“nodeType”: “n8n-nodes-base.httpRequest”,
“nodeVersion”: 4.2,
“itemIndex”: 0,
“time”: “12/02/2025, 09:31:46”,
“n8nVersion”: “1.77.3 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“NodeApiError: Forbidden - perhaps check your credentials?”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:525:33)“,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:633:19)“,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:882:51”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1216:20"
]
}
}

or

{
“errorMessage”: “The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.”,
“errorDetails”: {
“rawErrorMessage”: [
“The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.”
],
“httpCode”: “EAUTH”
},
“n8nDetails”: {
“nodeName”: “Post tweet on X”,
“nodeType”: “n8n-nodes-base.twitter”,
“nodeVersion”: 2,
“resource”: “tweet”,
“operation”: “create”,
“time”: “12/02/2025, 08:01:16”,
“n8nVersion”: “1.77.3 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“NodeApiError: The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.”,
" at ExecuteContext.twitterApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Twitter/V2/GenericFunctions.js:41:15)“,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Twitter/V2/TwitterV2.node.js:171:40)“,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:632:19)”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:881:51",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1215:20"
]
}
}

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.77.3
  • Database (default: SQLite): postgres / redis
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: windows 11

@ericocheung I’ve had success adding tweet.write + media.write simultaneously by also including all the other scopes (at least, the ones that n8n tries to login with automatically when connecting a Twitter account). Astonishing behavior from Twitter.

1 Like

@Raphael-Joel_Lim thanks for sharing this!

I was just adding offline.access tweet.write media.write in my credential, and it was always throwing error. Now I entered all of them and it worked. Can’t believe it was so simple!

Thanks again! Have a great one!

@Raphael-Joel_Lim sorry to bother you again. Have you had success posting videos / gifs, with the INIT, APPEND, FINALIZE process?

I’m going to try this now!

Thanks again!

@ericocheung I’ve only tried posting videos and that has worked. The main issue I’ve run into is staying under the file size limit. Not sure about gifs but I would be surprised if that didn’t work too.

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