Refresh token

Authentication · Acts onchain

Rotates an expiring access token using its refresh token. Access tokens are deliberately short-lived; the refresh token is what turns a signature made once into a session that lasts. Each rotation returns a fresh pair, so the caller always holds current credentials without asking the wallet to sign again. Step three of three in wallet authentication. Reach for it just before the access token expires, or on the first rejected request, and replace both stored tokens with what comes back.

Send a request

Request body

{
refresh_token: string
}

Response

{
data: {
access_token: string
refresh_token: string
expires_in: number
}
}

Code samples

Language

Claude

Prompt

Call the Plug API endpoint "Refresh token".
## Endpoint
POST /auth/refresh
Base URL: https://api.plug.to
## Description
Rotates an expiring access token using its refresh token.
Access tokens are deliberately short-lived; the refresh token is what turns a signature made once into a session that lasts. Each rotation returns a fresh pair, so the caller always holds current credentials without asking the wallet to sign again. Step three of three in wallet authentication.
Reach for it just before the access token expires, or on the first rejected request, and replace both stored tokens with what comes back.
## Request Body
- refresh_token (string, required) — The refresh token issued by /auth/verify or a prior refresh.
## Response Schema
- data (object, required)
- access_token (string, required) — Bearer token for the Authorization header.
- refresh_token (string, required) — Token used to rotate the pair once the access token expires.
- expires_in (integer, required) — Access token lifetime in seconds from issuance.
## Example Request
POST https://api.plug.to/auth/refresh