Critical Auth Error: "Cannot parse access token" with a 100% Valid Meta API Token (Instagram)

Hello,

I am facing a critical authentication issue when trying to connect to the Instagram Graph API. Any request from N8N (both self-hosted and cloud) results in a {"error":{"message":"Invalid OAuth access token - Cannot parse access token"}} from the Meta API.

I have performed extensive troubleshooting and can confirm the following with 100% certainty:

  1. The Access Token is PERFECTLY VALID. I have verified it using the official Meta Access Token Debugger. It is valid, not expired, and has all the required scopes, including instagram_content_publish. (I can provide a screenshot of the debugger result as proof).

  2. The Error Persists Across All Methods. The error occurs with both the native “Facebook Graph API” credential and the generic “Header Auth” credential.

  3. This is NOT an Environment Issue. I first experienced the error on my self-hosted Docker instance. I then created a brand new, clean account on n8n.cloud (alexvulf.app.n8n.cloud) and replicated the exact same workflow and error. This proves the issue is not related to my local environment.

  4. The Token String is NOT Being Corrupted. I used a text comparison tool (DiffChecker) to compare the token string copied from Meta against the string copied back out of the N8N credential field. The tool confirmed the strings are 100% identical. This proves there is no copy-paste error.

Conclusion: The problem is not the token, not the Meta App configuration, and not the user environment. The issue seems to be a very deep and rare bug in how N8N’s HTTP client is constructing or sending the final Authorization header, or a rare incompatibility between N8N and Meta’s API for my specific account.

Here is the full error log from the HTTP Request node on n8n.cloud:

NodeApiError: Authorization failed - please check your credentials
    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:780:15)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1212:9)
    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1582:27
    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_5aee33ef851c7de341eb325c6a25e0ff/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2158:11

Could you please investigate this? It seems to be a platform-level bug.

Thank you.

2 Likes

I got the same issue too. I think it is a platform bug or smth. I tried header auth and my own but nothing works.

I think I fixed it. Just had success connecting ig graph api. i changed the url to https://graph.instagram.com/v23.0/<recipient_id>/messages and then it started working.

1 Like

thank you I managed to make it work

Hey, can you provide the json you used, mine is something like ,the current version is v23.0

```python
api_url = f’https://graph.instagram.com/{os.getenv(“META_API_VERSION”)}/me/messages’

response : Response = requests.post(

    url = api_url , 

    params = {'access_token' : f' {access_token}'} , 

    headers = {

        'Content-Type' : 'application/json' , 

        'Authorization' : f'Bearer {access_token}'

    } , 

    json = {

        'recipient' : {'id' : recipient_id} , 

        'message' : {'text' : llm_response} , 

        'messaging_type' : 'RESPONSE'

    }

)

```