Error: invalid_cli_token

Error: invalid_cli_token

A `dsdk_*` CLI token is missing, expired, or revoked.

What it means

The request used a dsdk_*-prefixed token, but it didn't match any active CLI token in the database. CLI tokens are short-lived; they're paired with refresh tokens and rotate every few hours.

The CLI itself usually handles this transparently - devicesdk login writes both an access token and a refresh token to ~/.devicesdk/credentials.json, and subsequent calls auto-refresh. If you're seeing this code surface, it usually means refresh has also failed.

Common causes and fixes

  • You haven't logged in. Run devicesdk login --host http://<server>:8080.
  • The refresh token also expired (typical after long inactivity). Run devicesdk login --host http://<server>:8080 to issue a fresh pair.
  • You revoked the token from your server's dashboard. Run devicesdk login --host http://<server>:8080 to issue a new one.
  • You're sharing one ~/.devicesdk/credentials.json across machines. Each devicesdk login rotates the refresh token; only the most recent machine has the live one. Run devicesdk login again on whichever machine got 401'd.
  • You set DEVICESDK_TOKEN to a non-CLI token. Use a regular API token from your server's dashboard for that env var.