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: stringrefresh_token: stringexpires_in: number}}
Code samples
Language
Prompt
Call the Plug API endpoint "Refresh token".## EndpointPOST /auth/refreshBase URL: https://api.plug.to## DescriptionRotates 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 RequestPOST https://api.plug.to/auth/refresh