This is not the official Telnyx package, but it has been generated using the Telnyx OpenAPI spec to get a typescript first version of their APIs.
Install the package with:
npm install telnyx-api --save
The package needs to be configured with your account's API key which is available in your the Telnyx Mission Control Portal. Require it with the key's value:
import { Configuration, MessagingProfilesApi } from 'telnyx-api'
const config = new Configuration({
accessToken: 'KEY123456...',
})
const messagingProfiles = new MessagingProfilesApi(config);
const result = messagingProfiles.createMessagingProfile({
name: 'Summer Campaign',
whitelisted_destinations: [],
})
console.log(result)