api/ruby/telnyx-10dlc-ruby/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 Ruby SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-10dlc-rubyInstall 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.
gem install telnyx
require "telnyx"
client = Telnyx::Client.new(
api_key: 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
page = client.messaging_10dlc.brand.list
puts(page)
This endpoint is used to create a new brand.
POST /10dlc/brand — Required: entityType, displayName, country, email, vertical
telnyx_brand = client.messaging_10dlc.brand.create(
country: "US",
display_name: "ABC Mobile",
email: "email",
entity_type: :PRIVATE_PROFIT,
vertical: :TECHNOLOGY
)
puts(telnyx_brand)
Retrieve a brand by brandId.
GET /10dlc/brand/{brandId}
brand = client.messaging_10dlc.brand.retrieve("brandId")
puts(brand)
Update a brand's attributes by brandId.
PUT /10dlc/brand/{brandId} — Required: entityType, displayName, country, email, vertical
telnyx_brand = client.messaging_10dlc.brand.update(
"brandId",
country: "US",
display_name: "ABC Mobile",
email: "email",
entity_type: :PRIVATE_PROFIT,
vertical: :TECHNOLOGY
)
puts(telnyx_brand)
Delete Brand.
DELETE /10dlc/brand/{brandId}
result = client.messaging_10dlc.brand.delete("brandId")
puts(result)
POST /10dlc/brand/{brandId}/2faEmail
result = client.messaging_10dlc.brand.resend_2fa_email("brandId")
puts(result)
Get list of valid external vetting record for a given brand
GET /10dlc/brand/{brandId}/externalVetting
external_vettings = client.messaging_10dlc.brand.external_vetting.list("brandId")
puts(external_vettings)
Order new external vetting for a brand
POST /10dlc/brand/{brandId}/externalVetting — Required: evpId, vettingClass
response = client.messaging_10dlc.brand.external_vetting.order(
"brandId",
evp_id: "evpId",
vetting_class: "vettingClass"
)
puts(response)
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
response = client.messaging_10dlc.brand.external_vetting.imports("brandId", evp_id: "evpId", vetting_id: "vettingId")
puts(response)
This operation allows you to revet the brand.
PUT /10dlc/brand/{brandId}/revet
telnyx_brand = client.messaging_10dlc.brand.revet("brandId")
puts(telnyx_brand)
Query the status of an SMS OTP (One-Time Password) for Sole Proprietor brand verification using the Brand ID.
GET /10dlc/brand/{brandId}/smsOtp
response = client.messaging_10dlc.brand.retrieve_sms_otp_status("4b20019b-043a-78f8-0657-b3be3f4b4002")
puts(response)
Trigger or re-trigger an SMS OTP (One-Time Password) for Sole Proprietor brand verification.
POST /10dlc/brand/{brandId}/smsOtp — Required: pinSms, successSms
response = client.messaging_10dlc.brand.trigger_sms_otp(
"4b20019b-043a-78f8-0657-b3be3f4b4002",
pin_sms: "Your PIN is @OTP_PIN@",
success_sms: "Verification successful!"
)
puts(response)
Verify the SMS OTP (One-Time Password) for Sole Proprietor brand verification.
PUT /10dlc/brand/{brandId}/smsOtp — Required: otpPin
result = client.messaging_10dlc.brand.verify_sms_otp("4b20019b-043a-78f8-0657-b3be3f4b4002", otp_pin: "123456")
puts(result)
Get feedback about a brand by ID.
GET /10dlc/brand_feedback/{brandId}
response = client.messaging_10dlc.brand.get_feedback("brandId")
puts(response)
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
telnyx_campaign_csp = client.messaging_10dlc.campaign_builder.submit(
brand_id: "brandId",
description: "description",
usecase: "usecase"
)
puts(telnyx_campaign_csp)
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}
response = client.messaging_10dlc.campaign_builder.brand.qualify_by_usecase("usecase", brand_id: "brandId")
puts(response)
Retrieve a list of campaigns associated with a supplied brandId.
GET /10dlc/campaign
page = client.messaging_10dlc.campaign.list(brand_id: "brandId")
puts(page)
Retrieve campaign details by campaignId.
GET /10dlc/campaign/{campaignId}
telnyx_campaign_csp = client.messaging_10dlc.campaign.retrieve("campaignId")
puts(telnyx_campaign_csp)
Update a campaign's properties by campaignId.
PUT /10dlc/campaign/{campaignId}
telnyx_campaign_csp = client.messaging_10dlc.campaign.update("campaignId")
puts(telnyx_campaign_csp)
Terminate a campaign.
DELETE /10dlc/campaign/{campaignId}
response = client.messaging_10dlc.campaign.deactivate("campaignId")
puts(response)
Submits an appeal for rejected native campaigns in TELNYX_FAILED or MNO_REJECTED status.
POST /10dlc/campaign/{campaignId}/appeal — Required: appeal_reason
response = client.messaging_10dlc.campaign.submit_appeal(
"5eb13888-32b7-4cab-95e6-d834dde21d64",
appeal_reason: "The website has been updated to include the required privacy policy and terms of service."
)
puts(response)
Get the campaign metadata for each MNO it was submitted to.
GET /10dlc/campaign/{campaignId}/mnoMetadata
response = client.messaging_10dlc.campaign.get_mno_metadata("campaignId")
puts(response)
Retrieve campaign's operation status at MNO level.
GET /10dlc/campaign/{campaignId}/operationStatus
response = client.messaging_10dlc.campaign.get_operation_status("campaignId")
puts(response)
GET /10dlc/campaign/{campaignId}/osr_attributes
response = client.messaging_10dlc.campaign.osr.get_attributes("campaignId")
puts(response)
GET /10dlc/campaign/{campaignId}/sharing
response = client.messaging_10dlc.campaign.get_sharing_status("campaignId")
puts(response)
Manually accept a campaign shared with Telnyx
POST /10dlc/campaign/acceptSharing/{campaignId}
response = client.messaging_10dlc.campaign.accept_sharing("C26F1KLZN")
puts(response)
GET /10dlc/campaign/usecase_cost
response = client.messaging_10dlc.campaign.usecase.get_cost(usecase: "usecase")
puts(response)
Retrieve all partner campaigns you have shared to Telnyx in a paginated fashion.
GET /10dlc/partner_campaigns
page = client.messaging_10dlc.partner_campaigns.list
puts(page)
Retrieve campaign details by campaignId.
GET /10dlc/partner_campaigns/{campaignId}
telnyx_downstream_campaign = client.messaging_10dlc.partner_campaigns.retrieve("campaignId")
puts(telnyx_downstream_campaign)
Update campaign details by campaignId.
PATCH /10dlc/partner_campaigns/{campaignId}
telnyx_downstream_campaign = client.messaging_10dlc.partner_campaigns.update("campaignId")
puts(telnyx_downstream_campaign)
GET /10dlc/partnerCampaign/{campaignId}/sharing
response = client.messaging_10dlc.partner_campaigns.retrieve_sharing_status("campaignId")
puts(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
page = client.messaging_10dlc.partner_campaigns.list_shared_by_me
puts(page)
GET /10dlc/phone_number_campaigns
page = client.messaging_10dlc.phone_number_campaigns.list
puts(page)
POST /10dlc/phone_number_campaigns — Required: phoneNumber, campaignId
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.create(
campaign_id: "4b300178-131c-d902-d54e-72d90ba1620j",
phone_number: "+18005550199"
)
puts(phone_number_campaign)
Retrieve an individual phone number/campaign assignment by phoneNumber.
GET /10dlc/phone_number_campaigns/{phoneNumber}
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.retrieve("phoneNumber")
puts(phone_number_campaign)
PUT /10dlc/phone_number_campaigns/{phoneNumber} — Required: phoneNumber, campaignId
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.update(
"phoneNumber",
campaign_id: "4b300178-131c-d902-d54e-72d90ba1620j",
phone_number: "+18005550199"
)
puts(phone_number_campaign)
This endpoint allows you to remove a campaign assignment from the supplied phoneNumber.
DELETE /10dlc/phone_number_campaigns/{phoneNumber}
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.delete("phoneNumber")
puts(phone_number_campaign)
This endpoint allows you to link all phone numbers associated with a Messaging Profile to a campaign.
POST /10dlc/phoneNumberAssignmentByProfile — Required: messagingProfileId
response = client.messaging_10dlc.phone_number_assignment_by_profile.assign(
messaging_profile_id: "4001767e-ce0f-4cae-9d5f-0d5e636e7809"
)
puts(response)
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}
response = client.messaging_10dlc.phone_number_assignment_by_profile.retrieve_status("taskId")
puts(response)
Check the status of the individual phone number/campaign assignments associated with the supplied taskId.
GET /10dlc/phoneNumberAssignmentByProfile/{taskId}/phoneNumbers
response = client.messaging_10dlc.phone_number_assignment_by_profile.list_phone_number_status("taskId")
puts(response)
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.