Issue access token
client.auth.issueAccessToken(AuthIssueAccessTokenParams { grant_type, bound_entity } body, RequestOptionsoptions?): AuthIssueAccessTokenResponse { access_token, expires_in, token_type, bound_entity }
POST/v1/auth/access-tokens
Issues a short-lived access token from the authenticated API key. Access tokens can optionally be bound to a specific employer or employee for scoped access. Tokens expire after 15 minutes.
Issue access token
import VitableConnect from '@vitable-inc/vitable-connect';
const client = new VitableConnect({
apiKey: process.env['VITABLE_CONNECT_API_KEY'], // This is the default and can be omitted
});
const response = await client.auth.issueAccessToken({ grant_type: 'client_credentials' });
console.log(response.access_token);{
"access_token": "vit_at_abc123def456...",
"token_type": "Bearer",
"expires_in": 910,
"bound_entity": {
"id": "empr_SGVsbG8gV29ybGQ",
"type": "employer"
}
}Returns Examples
{
"access_token": "vit_at_abc123def456...",
"token_type": "Bearer",
"expires_in": 910,
"bound_entity": {
"id": "empr_SGVsbG8gV29ybGQ",
"type": "employer"
}
}