team-telnyx/telnyx-skills

telnyx-messaging-profiles-javascript

>- Create and manage messaging profiles with number pools, sticky sender, and geomatch features. Configure short codes for high-volume messaging. This skill provides JavaScript SDK examples.

First seen Mar 7, 2026

Installation

$ npx skills add team-telnyx/telnyx-skills --skill telnyx-messaging-profiles-javascript

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from team-telnyx/telnyx-skills · top by installs.

npx skills add team-telnyx/telnyx-skills

Browse all from team-telnyx/telnyx-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 188
License LICENSE
Default branch main
Open issues 2
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
author
telnyx
product
messaging-profiles
language
javascript
generated_by
telnyx-openapi-pipeline

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 11,511 B
  • docs SUMMARY.md 231 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 12 installs

SKILL.md

<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->

Telnyx Messaging Profiles - JavaScript

Installation

npm install [email protected]

Setup

import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

All examples below assume client is already initialized as shown above.

Error Handling

All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:

try {
  const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
  if (err instanceof Telnyx.APIConnectionError) {
    console.error('Network error — check connectivity and retry');
  } else if (err instanceof Telnyx.RateLimitError) {
    // 429: rate limited — wait and retry with exponential backoff
    const retryAfter = err.headers?.['retry-after'] || 1;
    await new Promise(r => setTimeout(r, retryAfter * 1000));
  } else if (err instanceof Telnyx.APIError) {
    console.error(`API error ${err.status}: ${err.message}`);
    if (err.status === 422) {
      console.error('Validation error — check required fields and formats');
    }
  }
}

Common error codes: 401 invalid API key, 403 insufficient permissions, 404 resource not found, 422 validation error (check field formats), 429 rate limited (retry with exponential backoff).

Important Notes

  • Pagination: List methods return an auto-paginating iterator. Use for await (const item of result) { ... } to iterate through all pages automatically.

List messaging profiles

GET /messaging_profiles

// Automatically fetches more pages as needed.
for await (const messagingProfile of client.messagingProfiles.list()) {
  console.log(messagingProfile.id);
}

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

Create a messaging profile

POST /messagingprofiles — Required: name, whitelisteddestinations

Optional: aiassistantid (string | null), alphasender (string | null), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), numberpoolsettings (object | null), resourcegroupid (string | null), smartencoding (boolean), urlshortenersettings (object | null), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url)

const messagingProfile = await client.messagingProfiles.create({
  name: 'My name',
  whitelisted_destinations: ['US'],
});

console.log(messagingProfile.data);

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

Retrieve a messaging profile

GET /messaging_profiles/{id}

const messagingProfile = await client.messagingProfiles.retrieve(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);

console.log(messagingProfile.data);

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

Update a messaging profile

PATCH /messaging_profiles/{id}

Optional: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), recordtype (enum: messagingprofile), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisteddestinations (array[string])

const messagingProfile = await client.messagingProfiles.update(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);

console.log(messagingProfile.data);

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

Delete a messaging profile

DELETE /messaging_profiles/{id}

const messagingProfile = await client.messagingProfiles.delete(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);

console.log(messagingProfile.data);

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

List phone numbers associated with a messaging profile

GET /messagingprofiles/{id}/phonenumbers

// Automatically fetches more pages as needed.
for await (const phoneNumberWithMessagingSettings of client.messagingProfiles.listPhoneNumbers(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
  console.log(phoneNumberWithMessagingSettings.id);
}

Returns: countrycode (string), createdat (date-time), eligiblemessagingproducts (array[string]), features (object), health (object), id (string), messagingproduct (string), messagingprofileid (string | null), organizationid (string), phonenumber (string), recordtype (enum: messagingphonenumber, messagingsettings), tags (array[string]), traffictype (string), type (enum: long-code, toll-free, short-code, longcode, tollfree, shortcode), updated_at (date-time)

List short codes associated with a messaging profile

GET /messagingprofiles/{id}/shortcodes

// Automatically fetches more pages as needed.
for await (const shortCode of client.messagingProfiles.listShortCodes(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
  console.log(shortCode.messaging_profile_id);
}

Returns: countrycode (string), createdat (date-time), id (uuid), messagingprofileid (string | null), recordtype (enum: shortcode), shortcode (string), tags (array), updatedat (date-time)

List short codes

GET /short_codes

// Automatically fetches more pages as needed.
for await (const shortCode of client.shortCodes.list()) {
  console.log(shortCode.messaging_profile_id);
}

Returns: countrycode (string), createdat (date-time), id (uuid), messagingprofileid (string | null), recordtype (enum: shortcode), shortcode (string), tags (array), updatedat (date-time)

Retrieve a short code

GET /short_codes/{id}

const shortCode = await client.shortCodes.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(shortCode.data);

Returns: countrycode (string), createdat (date-time), id (uuid), messagingprofileid (string | null), recordtype (enum: shortcode), shortcode (string), tags (array), updatedat (date-time)

Update short code

Update the settings for a specific short code. To unbind a short code from a profile, set the messagingprofileid to null or an empty string. To add or update tags, include the tags field as an array of strings.

PATCH /shortcodes/{id} — Required: messagingprofile_id

Optional: tags (array)

const shortCode = await client.shortCodes.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
  messaging_profile_id: 'abc85f64-5717-4562-b3fc-2c9600000000',
});

console.log(shortCode.data);

Returns: countrycode (string), createdat (date-time), id (uuid), messagingprofileid (string | null), recordtype (enum: shortcode), shortcode (string), tags (array), updatedat (date-time)