Authentication Required

unauthorized · 401

The API couldn't tell who is calling, because no credential it could use came with the request.

An expired token lands here too. A token the API read and will never accept answers invalid-token instead.

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

Common causes

  • The Authorization header is missing, or isn't in the Bearer <token> form.
  • The access token has expired. Access tokens are short-lived on purpose.
  • Only a browser session cookie came with the request, and that session has ended.

How to fix the call

  • Let the ghaym CLI sign in for you: set GHAYM_TOKEN to an API key and it exchanges the key for an access token, and renews it when it expires.
  • On a direct HTTP call, send Authorization: Bearer <access token>, and get a fresh token when this comes back. If a fresh token is refused too, stop and ask the user.
  • Never log the token or the key, and never write either into the working tree.

Example response

json
{
  "type": "unauthorized",
  "title": "Authentication Required",
  "status": 401,
  "detail": "No JWT token or valid session cookie provided",
  "requestId": "req-1785231000000-4f7b2c9ae",
  "timestamp": "2026-07-28T09:30:00.000Z",
  "path": "/v1/projects",
  "method": "GET",
  "instance": "GET /v1/projects",
  "docs": "https://ghaym.me/docs/errors/unauthorized"
}