Invalid Token

invalid-token · 401

The API read the bearer token and won't accept it, so retrying with the same token can't succeed.

detail says which check refused it. When the API couldn't check the token at all, it answers auth-unavailable instead, and that one is worth a retry.

This type adds no members to the ones every error carries.

Common causes

  • The header carries the API key itself. The API takes the access token the key is exchanged for, and a key isn't a signed JSON Web Token.
  • The token was signed with a key the identity service doesn't publish: it was forged, or minted somewhere else.
  • The token was signed with a shared secret, a form the API no longer accepts, or with an algorithm it doesn't accept.

How to fix the call

  • Get a new access token. With the ghaym CLI, set GHAYM_TOKEN to an API key and let it make the exchange.
  • Throw the refused token away rather than retrying it.
  • If a freshly issued token is refused too, stop and tell the user, quoting detail and requestId.

Example response

json
{
  "type": "invalid-token",
  "title": "Invalid Token",
  "detail": "The bearer token is not a signed JSON Web Token.",
  "requestId": "req-1785231000000-4f7b2c9ae",
  "timestamp": "2026-07-28T09:30:00.000Z",
  "path": "/v1/projects",
  "method": "GET",
  "instance": "GET /v1/projects",
  "status": 401,
  "docs": "https://ghaym.me/docs/errors/invalid-token"
}