Skip to main contentSkip to FAQSkip to contact
HTTP 401Authentication

unauthorized

Invalid or missing API key.

Back to all errors

What this means

The Authorization header was missing, malformed, or the bearer token didn't match any known API key.

How to recover

Send `Authorization: Bearer <your-api-key>`. Check for trailing whitespace and environment mismatch (test vs live key).

Example response

All TetraFi errors include a stable code, a human-readable message, and a docs_url pointing to this page.

JSON
1{
2 "error": {
3 "code": "unauthorized",
4 "message": "Invalid or missing API key.",
5 "docs_url": "https://tetrafi.io/docs/integration/errors/unauthorized/"
6 }
7}
7 linesjson

Match in code

TypeScript
1try {
2 await tetrafi.rfq.create({ /* ... */ });
3} catch (err) {
4 if (err.code === "unauthorized") {
5 // Send `Authorization: Bearer <your-api-key>`. Check for trailing whitespace and environment mismatch (test vs live key).
6 }
7 throw err;
8}
8 linestypescript

Related authentication errors