Skip to main content

Renew Your Token (JWT)

Endpoint​

https://api.verifik.co/v2/auth/session

This method renews the access token generated with other login endpoints, with a validity period of 30 days. After this period, it is necessary to generate a new Access Token. The only parameter required for renewal is the previous token, as long as it has not expired. This service only renews tokens that are still valid.

Headers​

NameValue
Authorization<token>

Parameters​

NameTypeRequiredDescription
originstringNoDefines the action to perform with the token. In this case, the action will be "refresh".
expiresInnumberNoInteger representing months: 1 = 1 month, 2 = 2 months, etc.

Request​

import axios from 'axios';

const options = {
method: 'GET',
url: 'https://api.verifik.co/v2/auth/session',
params: {origin: 'refresh', expiresIn: 120},
headers: {
Authorization: '<token>'
}
};

try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}

Response​

{
"accessToken": "eyJhbGcpXVCJ9.eyJjbGllbnR...JZCIYiUzNjEaIWxYShWeBaRs",
"tokenType": "bearer"
}