INSUFFICIENT_SCOPE
The token lacks a scope the operation needs. WWW-Authenticate names the missing scope (error="insufficient_scope", scope="…").
Typical cause
The credential was created with fewer scopes than the program now uses, or the token request's scope asked for a subset. Linking a historical invoice to a transaction, for example, also needs ledger:write.
Fix
Ask for the scope when you request the token (a credential can only grant the scopes it was created with), then retry.
Where it comes from
Any operation can answer it (HTTP 403).
Related
{
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "…",
"request_id": "req_01JB4Z0K3Q7V8W9X0Y1Z2A3B4C",
"doc_url": "https://developers.tracken.ee/errors/INSUFFICIENT_SCOPE"
}
}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 accounts create …
# exits 5 and prints the code, the message, each field problem and the request idimport { isApiError } from "@tracken/sdk";
try {
await tracken.accounts.create(…);
} catch (error) {
if (!isApiError(error, "INSUFFICIENT_SCOPE")) throw error;
// Ask for the scope when you request the token (a credential can only grant the scopes it was created with), then retry.
}