Skip to main content
Refresh a bearer token

Refresh a bearer token

Uses a refresh token to obtain a new access token and refresh token without requiring the customer to re-enter their password. This is useful when the access token has expired but you want to maintain the customer’s session.
Unlike most Nexudus API endpoints, this request must be encoded as application/x-www-form-urlencoded, not application/json. Sending a JSON body will result in an unsupported_grant_type error.

Authentication

No authentication required. This endpoint uses the refresh token itself as the credential.

Request Body

string
required
Must be refresh_token to use the refresh token grant flow.
string
required
The refresh token previously received from the sign-in endpoint.

Headers

string
required
The client identifier that was used when obtaining the bearer token. If the client_id was provided during sign-in, use that value. If client_id was omitted during sign-in, use the customer’s email address (which defaults to the client_id automatically).

Response

string
New bearer token to include in the Authorization header of all subsequent authenticated requests.
string
Token scheme. Always bearer.
number
Lifetime of the new access token in seconds.
string
New refresh token to use for subsequent refresh operations. The previous refresh token is invalidated.

Examples

Successful token refresh

TypeScript Integration

Error Responses

error
The grant_type field is missing or the body was not encoded as application/x-www-form-urlencoded.
error
The refresh token is invalid, expired, or has already been used. The error_description field contains a human-readable reason.