Check out our upcoming events and meetups! View events →
Exchange authorization code, client credentials, or refresh token for access token
import Telnyx from 'telnyx';
const client = new Telnyx();
const response = await client.oauth.token({ grant_type: 'client_credentials' });
console.log(response.access_token);{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"scope": "<string>",
"refresh_token": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
OAuth 2.0 grant type
client_credentials, authorization_code, refresh_token Space-separated list of requested scopes (for client_credentials)
"admin"
Authorization code (for authorization_code flow)
Redirect URI (for authorization_code flow)
PKCE code verifier (for authorization_code flow)
Refresh token (for refresh_token flow)
OAuth client ID (if not using HTTP Basic auth)
OAuth client secret (if not using HTTP Basic auth)
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx();
const response = await client.oauth.token({ grant_type: 'client_credentials' });
console.log(response.access_token);{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"scope": "<string>",
"refresh_token": "<string>"
}