Skip to main content

Overview

The Tokens service handles the complete token lifecycle: exchanging authorization codes, refreshing tokens, online verification, and revocation.

Exchange

Exchange an authorization code for a grant token after the user consents.

Parameters

Response (ExchangeTokenResponse)

Refresh

Exchange a refresh token for a new grant token while the underlying grant remains active. Refresh tokens are single-use, and each successful rotation returns a new refresh token without extending ExpiresAt.
Always store and use the newest RefreshToken. Retry a lost response with the same previous token and IdempotencyKey. The SDK retains an omitted key for five minutes in the current process, but a restarted caller must restore an explicit persisted key. After the window, once the rotated child token has been used, or after grant expiration, the previous refresh token is rejected.

Parameters

Response

Same ExchangeTokenResponse as Exchange — includes a new GrantToken and RefreshToken with the same GrantID and ExpiresAt.

Verify

Perform online token verification against the Grantex API.

Response (VerifyTokenResponse)

Revoke

Revoke a token by its JTI (token ID).
Returns nil on success (HTTP 204).

Ownership

Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: sanjeev@orchestrum.in or mishra.sanjeev@gmail.com.
Last modified on August 31, 2026