api/javascript/telnyx-10dlc-javascript/SKILL.md
Register brands and campaigns for 10DLC (10-digit long code) A2P messaging compliance in the US. Manage campaign assignments to phone numbers. This skill provides JavaScript SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-10dlc-javascriptInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
npm install telnyx
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.
This endpoint is used to list all brands associated with your organization.
GET /10dlc/brand
// Automatically fetches more pages as needed.
for await (const brandListResponse of client.messaging10dlc.brand.list()) {
console.log(brandListResponse.identityStatus);
}
This endpoint is used to create a new brand.
POST /10dlc/brand — Required: entityType, displayName, country, email, vertical
const telnyxBrand = await client.messaging10dlc.brand.create({
country: 'US',
displayName: 'ABC Mobile',
email: 'email',
entityType: 'PRIVATE_PROFIT',
vertical: 'TECHNOLOGY',
});
console.log(telnyxBrand.identityStatus);
Retrieve a brand by brandId.
GET /10dlc/brand/{brandId}
const brand = await client.messaging10dlc.brand.retrieve('brandId');
console.log(brand);
Update a brand's attributes by brandId.
PUT /10dlc/brand/{brandId} — Required: entityType, displayName, country, email, vertical
const telnyxBrand = await client.messaging10dlc.brand.update('brandId', {
country: 'US',
displayName: 'ABC Mobile',
email: 'email',
entityType: 'PRIVATE_PROFIT',
vertical: 'TECHNOLOGY',
});
console.log(telnyxBrand.identityStatus);
Delete Brand.
DELETE /10dlc/brand/{brandId}
await client.messaging10dlc.brand.delete('brandId');
POST /10dlc/brand/{brandId}/2faEmail
await client.messaging10dlc.brand.resend2faEmail('brandId');
Get list of valid external vetting record for a given brand
GET /10dlc/brand/{brandId}/externalVetting
const externalVettings = await client.messaging10dlc.brand.externalVetting.list('brandId');
console.log(externalVettings);
Order new external vetting for a brand
POST /10dlc/brand/{brandId}/externalVetting — Required: evpId, vettingClass
const response = await client.messaging10dlc.brand.externalVetting.order('brandId', {
evpId: 'evpId',
vettingClass: 'vettingClass',
});
console.log(response.createDate);
This operation can be used to import an external vetting record from a TCR-approved vetting provider.
PUT /10dlc/brand/{brandId}/externalVetting — Required: evpId, vettingId
const response = await client.messaging10dlc.brand.externalVetting.imports('brandId', {
evpId: 'evpId',
vettingId: 'vettingId',
});
console.log(response.createDate);
This operation allows you to revet the brand.
PUT /10dlc/brand/{brandId}/revet
const telnyxBrand = await client.messaging10dlc.brand.revet('brandId');
console.log(telnyxBrand.identityStatus);
Query the status of an SMS OTP (One-Time Password) for Sole Proprietor brand verification using the Brand ID.
GET /10dlc/brand/{brandId}/smsOtp
const response = await client.messaging10dlc.brand.retrieveSMSOtpStatus(
'4b20019b-043a-78f8-0657-b3be3f4b4002',
);
console.log(response.brandId);
Trigger or re-trigger an SMS OTP (One-Time Password) for Sole Proprietor brand verification.
POST /10dlc/brand/{brandId}/smsOtp — Required: pinSms, successSms
const response = await client.messaging10dlc.brand.triggerSMSOtp(
'4b20019b-043a-78f8-0657-b3be3f4b4002',
{ pinSms: 'Your PIN is @OTP_PIN@', successSms: 'Verification successful!' },
);
console.log(response.brandId);
Verify the SMS OTP (One-Time Password) for Sole Proprietor brand verification.
PUT /10dlc/brand/{brandId}/smsOtp — Required: otpPin
await client.messaging10dlc.brand.verifySMSOtp('4b20019b-043a-78f8-0657-b3be3f4b4002', {
otpPin: '123456',
});
Get feedback about a brand by ID.
GET /10dlc/brand_feedback/{brandId}
const response = await client.messaging10dlc.brand.getFeedback('brandId');
console.log(response.brandId);
Before creating a campaign, use the Qualify By Usecase endpoint to ensure that the brand you want to assign a new campaign...
POST /10dlc/campaignBuilder — Required: brandId, description, usecase
const telnyxCampaignCsp = await client.messaging10dlc.campaignBuilder.submit({
brandId: 'brandId',
description: 'description',
usecase: 'usecase',
});
console.log(telnyxCampaignCsp.brandId);
This endpoint allows you to see whether or not the supplied brand is suitable for your desired campaign use case.
GET /10dlc/campaignBuilder/brand/{brandId}/usecase/{usecase}
const response = await client.messaging10dlc.campaignBuilder.brand.qualifyByUsecase('usecase', {
brandId: 'brandId',
});
console.log(response.annualFee);
Retrieve a list of campaigns associated with a supplied brandId.
GET /10dlc/campaign
// Automatically fetches more pages as needed.
for await (const campaignListResponse of client.messaging10dlc.campaign.list({
brandId: 'brandId',
})) {
console.log(campaignListResponse.ageGated);
}
Retrieve campaign details by campaignId.
GET /10dlc/campaign/{campaignId}
const telnyxCampaignCsp = await client.messaging10dlc.campaign.retrieve('campaignId');
console.log(telnyxCampaignCsp.brandId);
Update a campaign's properties by campaignId.
PUT /10dlc/campaign/{campaignId}
const telnyxCampaignCsp = await client.messaging10dlc.campaign.update('campaignId');
console.log(telnyxCampaignCsp.brandId);
Terminate a campaign.
DELETE /10dlc/campaign/{campaignId}
const response = await client.messaging10dlc.campaign.deactivate('campaignId');
console.log(response.time);
Submits an appeal for rejected native campaigns in TELNYX_FAILED or MNO_REJECTED status.
POST /10dlc/campaign/{campaignId}/appeal — Required: appeal_reason
const response = await client.messaging10dlc.campaign.submitAppeal(
'5eb13888-32b7-4cab-95e6-d834dde21d64',
{
appeal_reason:
'The website has been updated to include the required privacy policy and terms of service.',
},
);
console.log(response.appealed_at);
Get the campaign metadata for each MNO it was submitted to.
GET /10dlc/campaign/{campaignId}/mnoMetadata
const response = await client.messaging10dlc.campaign.getMnoMetadata('campaignId');
console.log(response['10999']);
Retrieve campaign's operation status at MNO level.
GET /10dlc/campaign/{campaignId}/operationStatus
const response = await client.messaging10dlc.campaign.getOperationStatus('campaignId');
console.log(response);
GET /10dlc/campaign/{campaignId}/osr_attributes
const response = await client.messaging10dlc.campaign.osr.getAttributes('campaignId');
console.log(response);
GET /10dlc/campaign/{campaignId}/sharing
const response = await client.messaging10dlc.campaign.getSharingStatus('campaignId');
console.log(response.sharedByMe);
Manually accept a campaign shared with Telnyx
POST /10dlc/campaign/acceptSharing/{campaignId}
const response = await client.messaging10dlc.campaign.acceptSharing('C26F1KLZN');
console.log(response);
GET /10dlc/campaign/usecase_cost
const response = await client.messaging10dlc.campaign.usecase.getCost({ usecase: 'usecase' });
console.log(response.campaignUsecase);
Retrieve all partner campaigns you have shared to Telnyx in a paginated fashion.
GET /10dlc/partner_campaigns
// Automatically fetches more pages as needed.
for await (const telnyxDownstreamCampaign of client.messaging10dlc.partnerCampaigns.list()) {
console.log(telnyxDownstreamCampaign.tcrBrandId);
}
Retrieve campaign details by campaignId.
GET /10dlc/partner_campaigns/{campaignId}
const telnyxDownstreamCampaign = await client.messaging10dlc.partnerCampaigns.retrieve(
'campaignId',
);
console.log(telnyxDownstreamCampaign.tcrBrandId);
Update campaign details by campaignId.
PATCH /10dlc/partner_campaigns/{campaignId}
const telnyxDownstreamCampaign = await client.messaging10dlc.partnerCampaigns.update('campaignId');
console.log(telnyxDownstreamCampaign.tcrBrandId);
GET /10dlc/partnerCampaign/{campaignId}/sharing
const response = await client.messaging10dlc.partnerCampaigns.retrieveSharingStatus('campaignId');
console.log(response);
Get all partner campaigns you have shared to Telnyx in a paginated fashion
This endpoint is currently limited to only returning shared campaigns that Telnyx has accepted.
GET /10dlc/partnerCampaign/sharedByMe
// Automatically fetches more pages as needed.
for await (const partnerCampaignListSharedByMeResponse of client.messaging10dlc.partnerCampaigns.listSharedByMe()) {
console.log(partnerCampaignListSharedByMeResponse.brandId);
}
GET /10dlc/phone_number_campaigns
// Automatically fetches more pages as needed.
for await (const phoneNumberCampaign of client.messaging10dlc.phoneNumberCampaigns.list()) {
console.log(phoneNumberCampaign.campaignId);
}
POST /10dlc/phone_number_campaigns — Required: phoneNumber, campaignId
const phoneNumberCampaign = await client.messaging10dlc.phoneNumberCampaigns.create({
campaignId: '4b300178-131c-d902-d54e-72d90ba1620j',
phoneNumber: '+18005550199',
});
console.log(phoneNumberCampaign.campaignId);
Retrieve an individual phone number/campaign assignment by phoneNumber.
GET /10dlc/phone_number_campaigns/{phoneNumber}
const phoneNumberCampaign = await client.messaging10dlc.phoneNumberCampaigns.retrieve(
'phoneNumber',
);
console.log(phoneNumberCampaign.campaignId);
PUT /10dlc/phone_number_campaigns/{phoneNumber} — Required: phoneNumber, campaignId
const phoneNumberCampaign = await client.messaging10dlc.phoneNumberCampaigns.update('phoneNumber', {
campaignId: '4b300178-131c-d902-d54e-72d90ba1620j',
phoneNumber: '+18005550199',
});
console.log(phoneNumberCampaign.campaignId);
This endpoint allows you to remove a campaign assignment from the supplied phoneNumber.
DELETE /10dlc/phone_number_campaigns/{phoneNumber}
const phoneNumberCampaign = await client.messaging10dlc.phoneNumberCampaigns.delete('phoneNumber');
console.log(phoneNumberCampaign.campaignId);
This endpoint allows you to link all phone numbers associated with a Messaging Profile to a campaign.
POST /10dlc/phoneNumberAssignmentByProfile — Required: messagingProfileId
const response = await client.messaging10dlc.phoneNumberAssignmentByProfile.assign({
messagingProfileId: '4001767e-ce0f-4cae-9d5f-0d5e636e7809',
});
console.log(response.messagingProfileId);
Check the status of the task associated with assigning all phone numbers on a messaging profile to a campaign by taskId.
GET /10dlc/phoneNumberAssignmentByProfile/{taskId}
const response = await client.messaging10dlc.phoneNumberAssignmentByProfile.retrieveStatus(
'taskId',
);
console.log(response.status);
Check the status of the individual phone number/campaign assignments associated with the supplied taskId.
GET /10dlc/phoneNumberAssignmentByProfile/{taskId}/phoneNumbers
const response = await client.messaging10dlc.phoneNumberAssignmentByProfile.listPhoneNumberStatus(
'taskId',
);
console.log(response.records);
The following webhook events are sent to your configured webhook URL.
All webhooks include telnyx-timestamp and telnyx-signature-ed25519 headers for verification (Standard Webhooks compatible).
| Event | Description |
|-------|-------------|
| campaignStatusUpdate | Campaign Status Update |
tools
Build cross-platform VoIP calling apps with React Native using Telnyx Voice SDK. High-level reactive API with automatic lifecycle management, CallKit/ConnectionService integration, and push notifications. Use for mobile VoIP apps with minimal setup.
tools
Build browser-based VoIP calling apps using Telnyx WebRTC JavaScript SDK. Covers authentication, voice calls, events, debugging, call quality metrics, and AI Agent integration. Use for web-based real-time communication.
tools
Build VoIP calling apps on iOS using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, CallKit integration, PushKit/APNS push notifications, call quality metrics, and AI Agent integration. Use when implementing real-time voice communication on iOS.
tools
Build cross-platform VoIP calling apps with Flutter using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, push notifications (FCM + APNS), call quality metrics, and AI Agent integration. Works on Android, iOS, and Web.