UNAUTHENTICATED
The request carried no valid access token: none, expired, malformed, or issued for another audience or issuer. WWW-Authenticate says invalid_token when a token was sent.
Typical cause
The token expired: a client-credentials token lives 10 minutes, and a long job or a cached token outlives it. Less often the header is missing, or the token was issued for another environment's audience.
Fix
- Get a new token (client credentials again, or
tracken loginfor a person) and retry once. - Do not retry with the same token.
Where it comes from
Any operation can answer it (HTTP 401).
Related
{
"error": {
"code": "UNAUTHENTICATED",
"message": "…",
"request_id": "req_01JB4Z0K3Q7V8W9X0Y1Z2A3B4C",
"doc_url": "https://developers.tracken.ee/errors/UNAUTHENTICATED"
}
}code, never on message, which is developer-facing English and may change. Field problems are in details, each with a JSON Pointer; the figures for your own text are in context. Quote request_id when you contact support.tracken contacts list …
# exits 4 and prints the code, the message, each field problem and the request idimport { isApiError } from "@tracken/sdk";
try {
await tracken.contacts.list(…);
} catch (error) {
if (!isApiError(error, "UNAUTHENTICATED")) throw error;
// Get a new token (client credentials again, or tracken login for a person) and retry once.
}