token_expired: The browser token has expired

The token is genuine and was not revoked, but its lifetime has run out. Every browser token carries the expiry set when it was minted: a widget token lives at most 900 seconds (300 by default), a budget link 7 days by default, a portal token one hour by default, and a top-up link one hour by default. The check runs on the widget routes, budget links, the portal and the top-up page.

The multi-tenant hosted tier answers the same way: the front door passes the token to the account's core, which checks the expiry.

What to do

On the wire

HTTP 401, error type authentication_error. The widget routes always answer JSON; the budget link, portal and top-up pages answer a short HTML page naming the code, or JSON to a client that sends Accept: application/json (and not text/html):

{
  "error": "unauthorized",
  "errorDetail": {
    "type": "authentication_error",
    "code": "token_expired",
    "message": "the token has expired",
    "param": null,
    "doc_url": "…/developers/widgets.md#token-expired",
    "fix": "the token has expired; the app mints a new one"
  }
}

The top-up page points doc_url at the top-up guide instead. See all error codes.