Problem with N8N API Key

Hello Support Team,
I’m having an issue with my n8n API key. The key does not start with “n8n_api_” as expected from the documentation; instead, it starts with “eyJ…”. Using this key, authentication against the Cloud API fails.
Could you please:
Verify whether my key was issued correctly and, if necessary, provide a new key with the “n8n_api_” prefix; or
Confirm the correct authentication scheme (required header and expected token/prefix) for the Cloud API?
Repro context:
Workspace/Project: [name or project ID]
Endpoint (example): https://api.n8n.cloud/api/v1/projects/{PROJECT_ID}/workflows
Request header used: Authorization: Bearer <my_key_starting_with_eyJ…>
Timestamp: [DD.MM.YYYY, HH:MM, Europe/Berlin]
Result/Response: [e.g., 401/403 + error message]
Thank you in advance.
Best regards,
Livia

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

The name of the header as per the docs should be:

X-N8N-API-KEY: eyJ........

Can you try like this?

He still doesn´t want to use the Key

Can you post your entire API request with obfuscated values + the error you get? I don’t find any https://api.n8n.cloud/api/v1/projects/{PROJECT_ID}/workflows endpoint in the docs

(Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJmN2M1NDU1Zi01MWYyLTQ0NDItODYzMC1lYjczNjMwZTEyMGQiLCJpc3MiOiJuOG4iLCJhdWQiOiJwdWJsaWMtYXBpIiwiaWF0IjoxNzU3OTM2MTQyfQ.dFrooqM3IRIWpZIk-ZjqOCMXE0GM-roxksEjDKW1_I0 ) https://livia2002.app.n8n.cloud/rest/workflows

Thank you, but never share your API key, I would recommend deleting this one and creating a new one, as someone could use it now.

Could you also share the Body of your request - I need to understand what you’re sending to the API :slight_smile:

What is your use case? There are built in n8n nodes which you can use to get workflow information as well

Based on the API reference doc the create workflow endpoint should be

https://your-instance-name.app.n8n.cloud/api/v1/workflows 

Try it.

Here is a full expected request from the doc:

curl https://your-instance-name.app.n8n.cloud/api/v1/workflows \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-N8N-API-KEY: YOUR_SECRET_TOKEN' \
  --data '{
  "name": "Workflow 1",
  "nodes": [
    {
      "id": "0f5532f9-36ba-4bef-86c7-30d607400b15",
      "name": "Jira",
      "webhookId": "",
      "disabled": true,
      "notesInFlow": true,
      "notes": "",
      "type": "n8n-nodes-base.jira",
      "typeVersion": 1,
      "executeOnce": false,
      "alwaysOutputData": false,
      "retryOnFail": false,
      "maxTries": 1,
      "waitBetweenTries": 1,
      "onError": "stopWorkflow",
      "position": [
        -100,
        80
      ],
      "parameters": {
        "additionalProperties": {}
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "35",
          "name": "jiraApi"
        }
      }
    }
  ],
  "connections": {
    "Jira": {
      "main": [
        [
          {
            "node": "Jira",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "saveExecutionProgress": true,
    "saveManualExecutions": true,
    "saveDataErrorExecution": "all",
    "saveDataSuccessExecution": "all",
    "executionTimeout": 3600,
    "errorWorkflow": "VzqKEW0ShTXA5vPj",
    "timezone": "America/New_York",
    "executionOrder": "v1"
  },
  "staticData": {
    "lastId": 1
  },
  "shared": [
    {
      "role": "workflow:owner",
      "workflowId": "2tUt1wbLX592XDdX",
      "projectId": "2tUt1wbLX592XDdX",
      "project": {
        "name": ""
      }
    }
  ]
}'