Skip to main content

Renew your token (JWT)

Endpoint​

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

This method is responsible for renewing the access token generated using other login endpoints, which has 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 access token, as long as it has not expired. This service only renews tokens that are still valid.

Headers​

NameValue
Authorization<token>

Parameters​

NameTypeRequiredDescription
originstringNoDefine what we are going to do with the token. In this case, the action will be "refresh".
expiresInnumberNoNumber that can range from 1 to any number you wish. Each multiple represents a month, meaning 1: 1 month, 2: two months, 100: 100 months.

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"
}

Features​

  • Token Renewal: Renew access tokens to extend their validity period
  • 30-Day Validity: Extended tokens remain valid for 30 days
  • Simple Process: Only requires the existing valid token
  • Structured Response: Organized data format for easy integration
  • Multiple Programming Languages: Support for JavaScript, Python, PHP, and Swift
  • Error Handling: Comprehensive error responses for various scenarios