Skip to content
Documentation
Hevia for developers

Token lifetime

How long codes, access tokens, refresh tokens and keys live, and how refresh rotation works.

CredentialLifetimeNotes
Consent screen10 minutesStart again from the authorize URL afterwards.
Authorization code hcode_…60 secondsSingle use. A second use revokes the grant's tokens.
Access token60 minutesWorks like an API key (hv_live_…).
Refresh token hr_…30 daysRotates on every use.
API keyUntil revoked, or 30 / 90 / 180 / 365 daysRotation with a grace period.

Refresh

Shell
curl -X POST https://hevia.app/api/oauth/token \
  -d grant_type=refresh_token \
  -d refresh_token=hr_... \
  -d client_id=hc_...

Every refresh returns a new refresh token and ends the previous access token. If a refresh token that was already used comes back, Hevia assumes it leaked and ends the whole grant.

Warning

Store the new refresh token before you use the new access token. If you lose it, the person has to connect again.

Revoke and introspect

  • POST /api/oauth/revoke: token, client_id (and client_secret for confidential clients). A refresh token ends the grant, an access token only itself.
  • POST /api/oauth/introspect: returns active, scope, client_id, exp, hevia_business. You only see your own tokens.
  • The business can end any app at any time under API > Apps; its token stops at once.

Generated from the product's own registries, so the reference matches the API.