Skip to main content
telnyx-10dlc-javascript 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.
跳到安装 Skills Marketplace 发现并探索由社区构建的 Agent Skills
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/team-telnyx/telnyx-toolkit --skill telnyx-10dlc-javascript命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
下载 Zip 下载中... 同仓库更多 Skills Complete Telnyx toolkit — ready-to-use tools (STT, TTS, RAG, Networking, 10DLC) plus SDK documentation for JavaScript, Python, Go, Java, and Ruby.
Automated Telnyx bot account signup via challenge-response
Track agent activities using the Telnyx AI Missions API. Use this skill when executing multi-step tasks that should be logged and tracked. Supports creating voice/SMS agents, scheduling calls, and retrieving conversation insights. Use when tasks involve calling people, sending SMS, or any substantial tracked work.
name telnyx-10dlc-javascript description 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. metadata {"author":"telnyx","product":"10dlc","language":"javascript","generated_by":"telnyx-ext-skills-generator"}
Telnyx 10Dlc - JavaScript
Installation
npm install telnyx
Setup
import Telnyx from 'telnyx' ;
const client = new Telnyx ({
apiKey : process.env ['TELNYX_API_KEY' ],
});
All examples below assume client is already initialized as shown above.
List Brands
This endpoint is used to list all brands associated with your organization.
GET /10dlc/brand
for await (const brandListResponse of client.messaging10dlc . . ()) {
. (brandListResponse. );
}
brand
list
console
log
identityStatus
Create Brand 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 );
Get Brand Retrieve a brand by brandId.
GET /10dlc/brand/{brandId}
const brand = await client.messaging10dlc .brand .retrieve ('brandId' );
console .log (brand);
Update 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' );
Resend brand 2FA email POST /10dlc/brand/{brandId}/2faEmail
await client.messaging10dlc .brand .resend2faEmail ('brandId' );
List External Vettings 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 Brand External Vetting 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 );
Import External Vetting Record 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 );
Revet Brand 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 );
Get Brand SMS OTP Status by Brand ID 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 Brand SMS OTP 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 Brand SMS OTP 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 Brand Feedback By Id Get feedback about a brand by ID.
GET /10dlc/brand_feedback/{brandId}
const response = await client.messaging10dlc .brand .getFeedback ('brandId' );
console .log (response.brandId );
Submit 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 );
Qualify By Usecase 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 );
List Campaigns Retrieve a list of campaigns associated with a supplied brandId.
for await (const campaignListResponse of client.messaging10dlc .campaign .list ({
brandId : 'brandId' ,
})) {
console .log (campaignListResponse.ageGated );
}
Get campaign Retrieve campaign details by campaignId.
GET /10dlc/campaign/{campaignId}
const telnyxCampaignCsp = await client.messaging10dlc .campaign .retrieve ('campaignId' );
console .log (telnyxCampaignCsp.brandId );
Update campaign Update a campaign's properties by campaignId.
PUT /10dlc/campaign/{campaignId}
const telnyxCampaignCsp = await client.messaging10dlc .campaign .update ('campaignId' );
console .log (telnyxCampaignCsp.brandId );
Deactivate campaign DELETE /10dlc/campaign/{campaignId}
const response = await client.messaging10dlc .campaign .deactivate ('campaignId' );
console .log (response.time );
Submit campaign appeal for manual review 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 Campaign Mno Metadata 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' ]);
Get campaign operation status 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 OSR campaign attributes GET /10dlc/campaign/{campaignId}/osr_attributes
const response = await client.messaging10dlc .campaign .osr .getAttributes ('campaignId' );
console .log (response);
Get Sharing Status GET /10dlc/campaign/{campaignId}/sharing
const response = await client.messaging10dlc .campaign .getSharingStatus ('campaignId' );
console .log (response.sharedByMe );
Accept Shared Campaign Manually accept a campaign shared with Telnyx
POST /10dlc/campaign/acceptSharing/{campaignId}
const response = await client.messaging10dlc .campaign .acceptSharing ('C26F1KLZN' );
console .log (response);
Get Campaign Cost GET /10dlc/campaign/usecase_cost
const response = await client.messaging10dlc .campaign .usecase .getCost ({ usecase : 'usecase' });
console .log (response.campaignUsecase );
List Shared Campaigns Retrieve all partner campaigns you have shared to Telnyx in a paginated fashion.
GET /10dlc/partner_campaigns
for await (const telnyxDownstreamCampaign of client.messaging10dlc .partnerCampaigns .list ()) {
console .log (telnyxDownstreamCampaign.tcrBrandId );
}
Get Single Shared Campaign Retrieve campaign details by campaignId.
GET /10dlc/partner_campaigns/{campaignId}
const telnyxDownstreamCampaign = await client.messaging10dlc .partnerCampaigns .retrieve (
'campaignId' ,
);
console .log (telnyxDownstreamCampaign.tcrBrandId );
Update Single Shared Campaign Update campaign details by campaignId.
PATCH /10dlc/partner_campaigns/{campaignId}
const telnyxDownstreamCampaign = await client.messaging10dlc .partnerCampaigns .update ('campaignId' );
console .log (telnyxDownstreamCampaign.tcrBrandId );
Get Sharing Status GET /10dlc/partnerCampaign/{campaignId}/sharing
const response = await client.messaging10dlc .partnerCampaigns .retrieveSharingStatus ('campaignId' );
console .log (response);
List shared partner campaigns 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
for await (const partnerCampaignListSharedByMeResponse of client.messaging10dlc .partnerCampaigns .listSharedByMe ()) {
console .log (partnerCampaignListSharedByMeResponse.brandId );
}
List phone number campaigns GET /10dlc/phone_number_campaigns
for await (const phoneNumberCampaign of client.messaging10dlc .phoneNumberCampaigns .list ()) {
console .log (phoneNumberCampaign.campaignId );
}
Create New Phone Number Campaign 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 );
Get Single Phone Number Campaign 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 );
Create New Phone Number Campaign 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 );
Delete Phone Number Campaign 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 );
Assign Messaging Profile To Campaign 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 );
Get Assignment Task Status 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 );
Get Phone Number 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 );
Webhooks 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 campaignStatusUpdateCampaign Status Update
相关职业
SOC