Skip to main content
Sign-up & auth·HTTP 401·API, CLI

API token rejected

INVALID_API_TOKEN

The API token in this request couldn't be validated.

What this means​

The token has been revoked, has expired, or was never issued by this account.

How to fix it​

Generate a new token from the dashboard under Settings → API Tokens, or run csph login to refresh CLI credentials.

Retry behavior​

Don't retry with the same token. Get a new one first.

How it appears in the response​

ComputeSphere returns errors as RFC 7807 Problem Details. The type field is the docs URL for this page — switch on code in your client.

{
"type": "https://docs.computesphere.com/errors/INVALID_API_TOKEN",
"title": "API token rejected",
"status": 401,
"code": "INVALID_API_TOKEN",
"detail": "The API token in this request couldn't be validated.",
"instance": "/v2/…",
"request_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"trace_id": null
}

The Content-Type header is application/problem+json. On field-level validation errors a non-empty errors[] array also appears, each entry carrying its own docs_url for the offending field.