/v1/auth/refreshRefresh access token using refresh token
Request body
refresh_token*stringRefresh token (JWT)
Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Response · 200 Token response
access_token*stringAccess token (JWT)
Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
refresh_tokenstringRefresh token (JWT)
Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
token_type*stringToken type
Example: "Bearer"
expires_in*numberAccess token TTL in seconds
Example: 3600
Example
Request
POST https://api.platform-auth.productcraft.co/v1/auth/refresh
Content-Type: application/json
{
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}import { PlatformAuth } from "@productcraft/platform-auth";
// Reads PRODUCTCRAFT_API_KEY from the environment; administration
// calls take a person's session: { auth: { type: "bearer", token } }
const platform = new PlatformAuth();
const token = await platform.auth.refresh({ refresh_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." });platform.auth.refresh(params, options?): PlatformAuth.Token
Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}