401 Unauthorized with API Key on n8n Cloud REST API

Hi n8n Support,

I am trying to use the n8n Cloud REST API at https://ai2112.app.n8n.cloud/rest/workflows with a freshly generated API key (“Aivery_AR_MVP2”, ending in HCJ8). I have confirmed:

  • The key is present, not expired, and has all required scopes.
  • I am using the correct header: Authorization: Bearer .
  • I have tested with both curl and Python, and both return 401 Unauthorized.
  • There are no extra spaces or line breaks in the key.
  • I am using the /rest/workflows endpoint, not /api.
  • The /api-docs endpoint is not available.

Is there an additional step to activate the key, or could there be a backend/account issue? Please advise.

Thank you!

Hi @matt2112

I think it’s X-N8N-API-KEY : Your_API

Don’t you need like v1 in the URL?

Thanks all…

The n8n Cloud API (v1.94-beta) now returns a nested JSON structure with workflows under a data field. We updated our code to extract workflows using response.json().get(‘data’, ), ensuring compatibility with the new API format. This resolved the 401 Unauthorised error and restored normal sync functionality.

2 Likes