All error codes

invalid_api_key

HTTP 403Not retryable

The supplied key is unknown, revoked, or expired.

How to resolve

  • Verify the key exists in your dashboard and has not been revoked.
  • Check for whitespace or truncation if copying the key manually.
  • Expired keys return this code — regenerate from the dashboard.

Example response

JSON

{
  "object": "error",
  "code": "invalid_api_key",
  "message": "The supplied key is unknown, revoked, or expired.",
  "request_id": "req_example123",
  "docs_url": "https://docs.statxt.com/api/errors/invalid_api_key"
}

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 === "invalid_api_key") {
    // The supplied key is unknown, revoked, or expired.
    console.error(err.requestId) // include in support tickets
  }
}

Public reference: /docs/errors/invalid_api_key