Check out our upcoming events and meetups! View events →
Create a new OAuth client
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const oauthClient = await client.oauthClients.create({
allowed_grant_types: ['client_credentials'],
allowed_scopes: ['admin'],
client_type: 'public',
name: 'My OAuth client',
});
console.log(oauthClient.data);{
"data": {
"record_type": "oauth_client",
"client_id": "<string>",
"name": "<string>",
"org_id": "<string>",
"user_id": "<string>",
"client_type": "public",
"require_pkce": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"allowed_scopes": [
"<string>"
],
"allowed_grant_types": [
"client_credentials"
],
"redirect_uris": [
"<string>"
],
"logo_uri": "<string>",
"tos_uri": "<string>",
"policy_uri": "<string>",
"client_secret": "<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.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The name of the OAuth client
"My OAuth client"
List of allowed OAuth scopes
["admin"]OAuth client type
public, confidential List of allowed OAuth grant types
client_credentials, authorization_code, refresh_token Whether PKCE (Proof Key for Code Exchange) is required for this client
List of redirect URIs (required for authorization_code flow)
URL of the client logo
URL of the client's privacy policy
URL of the client's terms of service
OAuth client created successfully
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const oauthClient = await client.oauthClients.create({
allowed_grant_types: ['client_credentials'],
allowed_scopes: ['admin'],
client_type: 'public',
name: 'My OAuth client',
});
console.log(oauthClient.data);{
"data": {
"record_type": "oauth_client",
"client_id": "<string>",
"name": "<string>",
"org_id": "<string>",
"user_id": "<string>",
"client_type": "public",
"require_pkce": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"allowed_scopes": [
"<string>"
],
"allowed_grant_types": [
"client_credentials"
],
"redirect_uris": [
"<string>"
],
"logo_uri": "<string>",
"tos_uri": "<string>",
"policy_uri": "<string>",
"client_secret": "<string>"
}
}