Refresh Access Token
const url = 'https://example.com/iam/v1/tokens:refresh';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"refresh_token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/iam/v1/tokens:refresh \ --header 'Content-Type: application/json' \ --data '{ "refresh_token": "example" }'Exchanges a valid refresh token for a new access token and refresh token pair. The old refresh token is consumed (deleted) and cannot be reused. This RPC does not require Bearer authentication — the refresh token itself is the credential.
Request Body required
Section titled “Request Body required ”RefreshTokenRequest
Request message for RefreshToken. Carries the refresh token to exchange for a new access + refresh token pair.
object
The refresh token value (prefixed with qbr_)
Example generated
{ "refresh_token": "example"}Responses
Section titled “ Responses ”OK
RefreshTokenResponse
Response message for RefreshToken. Carries a freshly issued access + refresh token pair and their expiry timestamps.
object
The new opaque access token
The expiration time of the new access token
The new opaque refresh token (replaces the consumed one)
The expiration time of the new refresh token
SHA-512 hex fingerprint of the new access token.
CLI/TUI clients use this as the stable session identifier — it matches
the row’s iam.tokens.token_hash for the just-rotated access token, so
clients never need to compute SHA-512 themselves.
Example generated
{ "access_token": "example", "refresh_token": "example"}default
Section titled “default ”Default error response
The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.
object
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
A list of messages that carry the error details. There is a common set of message types for APIs to use.
Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
object
The type of the serialized message.
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}