Skip to content
Community forum

401 when sending an API key as Authorization: Bearer

SolvedSupero SupportSupero team asked

Common question, written up by the Supero team.

Error message
401 Unauthorized

The key works in Postman. From Node every call is a 401:

js
headers: { Authorization: `Bearer ${process.env.SUPERO_KEY}` }
Link

1 answer

Accepted answer
Accepted answer

Send API keys in X-API-Key. Authorization: Bearer is for the JWT you get back from login; a key sent as Bearer gets 401. Send only one credential header. A default Authorization header added by a proxy or your HTTP client config is a common reason a correct key still fails.

js
headers: { 'X-API-Key': process.env.SUPERO_KEY }
Supero Platform teamSupero team answered
Link

Your answer

401 when sending an API key as Authorization: Bearer | Supero Community