All error codes
scope_invalid
HTTP 403Not retryableThe key's scope_level does not permit this resource. Personal keys cannot access organization-only resources (DNC, org-level usage, raw org number lists), and organization keys must be issued by a user who still holds the owner role.
Example response
JSON
{
"object": "error",
"code": "scope_invalid",
"message": "The key's scope_level does not permit this resource. Personal keys cannot access organization-only resources (DNC, org-level usage, raw org number lists), and organization keys must be issued by a user who still holds the owner role.",
"request_id": "req_example123",
"docs_url": "https://docs.statxt.com/api/errors/scope_invalid"
}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 === "scope_invalid") {
// The key's scope_level does not permit this resource. Personal keys cannot access organization-only resources (DNC, org-level usage, raw org number lists), and organization keys must be issued by a user who still holds the owner role.
console.error(err.requestId) // include in support tickets
}
}Public reference: /docs/errors/scope_invalid