Exchange Token
client.organizations.exchangeToken(stringorganizationID, OrganizationExchangeTokenParams { xClientRequestID } params?, RequestOptionsoptions?): TokenResponse { access_token, token_type, expires_in }
POST/organizations/{organization_id}/token
Exchange user token for organization-scoped M2M token
Parameters
organizationID: string
Organization ID or label identifier
minLength1
maxLength255
Returns
Exchange Token
import KeycardAPI from '@keycardai/api';
const client = new KeycardAPI();
const tokenResponse = await client.organizations.exchangeToken('x');
console.log(tokenResponse.access_token);{
"access_token": "access_token",
"token_type": "Bearer",
"expires_in": 3600
}Returns Examples
{
"access_token": "access_token",
"token_type": "Bearer",
"expires_in": 3600
}