All error codes
insufficient_scope
HTTP 403Not retryableThe key authenticated successfully but does not hold the scope required for this endpoint.
How to resolve
- The key authenticated but lacks the required scope for this endpoint.
- Create a new key with the correct scopes, or add scopes to the existing key in the dashboard.
Example response
JSON
{
"object": "error",
"code": "insufficient_scope",
"message": "The key authenticated successfully but does not hold the scope required for this endpoint.",
"request_id": "req_example123",
"docs_url": "https://docs.statxt.com/api/errors/insufficient_scope"
}SDK handling
TypeScript
import { StatxtClient, StatxtApiError } from "@statxt/sdk"
const client = new StatxtClient({ apiKey: process.env.STATXT_API_KEY! })
try {
await client.messages.send({ ... })
} catch (err) {
if (err instanceof StatxtApiError && err.code === "insufficient_scope") {
// The key authenticated successfully but does not hold the scope required for this endpoint.
console.error(err.requestId) // include in support tickets
}
}Public reference: /docs/errors/insufficient_scope