with one click
telnyx-10dlc-go
// 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 Go SDK examples.
// 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 Go SDK examples.
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 obfuscated mathematical challenge
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.
Automatically upgrade Telnyx account from freemium to professional tier
Test VoIP push notifications for Telnyx WebRTC iOS (APNs) and Android (FCM) apps. Use when debugging push notification delivery, validating certificate/credential setup, or testing that a device receives VoIP pushes correctly.
Text-to-vector embeddings and semantic search using Telnyx AI. Generate embedding vectors via an OpenAI-compatible API — no OpenAI or Google API keys required.
| name | telnyx-10dlc-go |
| 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 Go SDK examples. |
| metadata | {"author":"telnyx","product":"10dlc","language":"go","generated_by":"telnyx-ext-skills-generator"} |
go get github.com/team-telnyx/telnyx-go
import (
"context"
"fmt"
"os"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
client := telnyx.NewClient(
option.WithAPIKey(os.Getenv("TELNYX_API_KEY")),
)
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, err := client.Messaging10dlc.Brand.List(context.TODO(), telnyx.Messaging10dlcBrandListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
This endpoint is used to create a new brand.
POST /10dlc/brand — Required: entityType, displayName, country, email, vertical
telnyxBrand, err := client.Messaging10dlc.Brand.New(context.TODO(), telnyx.Messaging10dlcBrandNewParams{
Country: "US",
DisplayName: "ABC Mobile",
Email: "email",
EntityType: telnyx.EntityTypePrivateProfit,
Vertical: telnyx.VerticalTechnology,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", telnyxBrand.IdentityStatus)
Retrieve a brand by brandId.
GET /10dlc/brand/{brandId}
brand, err := client.Messaging10dlc.Brand.Get(context.TODO(), "brandId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", brand)
Update a brand's attributes by brandId.
PUT /10dlc/brand/{brandId} — Required: entityType, displayName, country, email, vertical
telnyxBrand, err := client.Messaging10dlc.Brand.Update(
context.TODO(),
"brandId",
telnyx.Messaging10dlcBrandUpdateParams{
Country: "US",
DisplayName: "ABC Mobile",
Email: "email",
EntityType: telnyx.EntityTypePrivateProfit,
Vertical: telnyx.VerticalTechnology,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", telnyxBrand.IdentityStatus)
Delete Brand.
DELETE /10dlc/brand/{brandId}
err := client.Messaging10dlc.Brand.Delete(context.TODO(), "brandId")
if err != nil {
panic(err.Error())
}
POST /10dlc/brand/{brandId}/2faEmail
err := client.Messaging10dlc.Brand.Resend2faEmail(context.TODO(), "brandId")
if err != nil {
panic(err.Error())
}
Get list of valid external vetting record for a given brand
GET /10dlc/brand/{brandId}/externalVetting
externalVettings, err := client.Messaging10dlc.Brand.ExternalVetting.List(context.TODO(), "brandId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", externalVettings)
Order new external vetting for a brand
POST /10dlc/brand/{brandId}/externalVetting — Required: evpId, vettingClass
response, err := client.Messaging10dlc.Brand.ExternalVetting.Order(
context.TODO(),
"brandId",
telnyx.Messaging10dlcBrandExternalVettingOrderParams{
EvpID: "evpId",
VettingClass: "vettingClass",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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
response, err := client.Messaging10dlc.Brand.ExternalVetting.Imports(
context.TODO(),
"brandId",
telnyx.Messaging10dlcBrandExternalVettingImportsParams{
EvpID: "evpId",
VettingID: "vettingId",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.CreateDate)
This operation allows you to revet the brand.
PUT /10dlc/brand/{brandId}/revet
telnyxBrand, err := client.Messaging10dlc.Brand.Revet(context.TODO(), "brandId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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
response, err := client.Messaging10dlc.Brand.GetSMSOtpStatus(context.TODO(), "4b20019b-043a-78f8-0657-b3be3f4b4002")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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
response, err := client.Messaging10dlc.Brand.TriggerSMSOtp(
context.TODO(),
"4b20019b-043a-78f8-0657-b3be3f4b4002",
telnyx.Messaging10dlcBrandTriggerSMSOtpParams{
PinSMS: "Your PIN is @OTP_PIN@",
SuccessSMS: "Verification successful!",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.BrandID)
Verify the SMS OTP (One-Time Password) for Sole Proprietor brand verification.
PUT /10dlc/brand/{brandId}/smsOtp — Required: otpPin
err := client.Messaging10dlc.Brand.VerifySMSOtp(
context.TODO(),
"4b20019b-043a-78f8-0657-b3be3f4b4002",
telnyx.Messaging10dlcBrandVerifySMSOtpParams{
OtpPin: "123456",
},
)
if err != nil {
panic(err.Error())
}
Get feedback about a brand by ID.
GET /10dlc/brand_feedback/{brandId}
response, err := client.Messaging10dlc.Brand.GetFeedback(context.TODO(), "brandId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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
telnyxCampaignCsp, err := client.Messaging10dlc.CampaignBuilder.Submit(context.TODO(), telnyx.Messaging10dlcCampaignBuilderSubmitParams{
BrandID: "brandId",
Description: "description",
Usecase: "usecase",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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}
response, err := client.Messaging10dlc.CampaignBuilder.Brand.QualifyByUsecase(
context.TODO(),
"usecase",
telnyx.Messaging10dlcCampaignBuilderBrandQualifyByUsecaseParams{
BrandID: "brandId",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.AnnualFee)
Retrieve a list of campaigns associated with a supplied brandId.
GET /10dlc/campaign
page, err := client.Messaging10dlc.Campaign.List(context.TODO(), telnyx.Messaging10dlcCampaignListParams{
BrandID: "brandId",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Retrieve campaign details by campaignId.
GET /10dlc/campaign/{campaignId}
telnyxCampaignCsp, err := client.Messaging10dlc.Campaign.Get(context.TODO(), "campaignId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", telnyxCampaignCsp.BrandID)
Update a campaign's properties by campaignId.
PUT /10dlc/campaign/{campaignId}
telnyxCampaignCsp, err := client.Messaging10dlc.Campaign.Update(
context.TODO(),
"campaignId",
telnyx.Messaging10dlcCampaignUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", telnyxCampaignCsp.BrandID)
Terminate a campaign.
DELETE /10dlc/campaign/{campaignId}
response, err := client.Messaging10dlc.Campaign.Deactivate(context.TODO(), "campaignId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Time)
Submits an appeal for rejected native campaigns in TELNYX_FAILED or MNO_REJECTED status.
POST /10dlc/campaign/{campaignId}/appeal — Required: appeal_reason
response, err := client.Messaging10dlc.Campaign.SubmitAppeal(
context.TODO(),
"5eb13888-32b7-4cab-95e6-d834dde21d64",
telnyx.Messaging10dlcCampaignSubmitAppealParams{
AppealReason: "The website has been updated to include the required privacy policy and terms of service.",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.AppealedAt)
Get the campaign metadata for each MNO it was submitted to.
GET /10dlc/campaign/{campaignId}/mnoMetadata
response, err := client.Messaging10dlc.Campaign.GetMnoMetadata(context.TODO(), "campaignId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Number10999)
Retrieve campaign's operation status at MNO level.
GET /10dlc/campaign/{campaignId}/operationStatus
response, err := client.Messaging10dlc.Campaign.GetOperationStatus(context.TODO(), "campaignId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
GET /10dlc/campaign/{campaignId}/osr_attributes
response, err := client.Messaging10dlc.Campaign.Osr.GetAttributes(context.TODO(), "campaignId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
GET /10dlc/campaign/{campaignId}/sharing
response, err := client.Messaging10dlc.Campaign.GetSharingStatus(context.TODO(), "campaignId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.SharedByMe)
Manually accept a campaign shared with Telnyx
POST /10dlc/campaign/acceptSharing/{campaignId}
response, err := client.Messaging10dlc.Campaign.AcceptSharing(context.TODO(), "C26F1KLZN")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
GET /10dlc/campaign/usecase_cost
response, err := client.Messaging10dlc.Campaign.Usecase.GetCost(context.TODO(), telnyx.Messaging10dlcCampaignUsecaseGetCostParams{
Usecase: "usecase",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.CampaignUsecase)
Retrieve all partner campaigns you have shared to Telnyx in a paginated fashion.
GET /10dlc/partner_campaigns
page, err := client.Messaging10dlc.PartnerCampaigns.List(context.TODO(), telnyx.Messaging10dlcPartnerCampaignListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Retrieve campaign details by campaignId.
GET /10dlc/partner_campaigns/{campaignId}
telnyxDownstreamCampaign, err := client.Messaging10dlc.PartnerCampaigns.Get(context.TODO(), "campaignId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", telnyxDownstreamCampaign.TcrBrandID)
Update campaign details by campaignId.
PATCH /10dlc/partner_campaigns/{campaignId}
telnyxDownstreamCampaign, err := client.Messaging10dlc.PartnerCampaigns.Update(
context.TODO(),
"campaignId",
telnyx.Messaging10dlcPartnerCampaignUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", telnyxDownstreamCampaign.TcrBrandID)
GET /10dlc/partnerCampaign/{campaignId}/sharing
response, err := client.Messaging10dlc.PartnerCampaigns.GetSharingStatus(context.TODO(), "campaignId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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, err := client.Messaging10dlc.PartnerCampaigns.ListSharedByMe(context.TODO(), telnyx.Messaging10dlcPartnerCampaignListSharedByMeParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
GET /10dlc/phone_number_campaigns
page, err := client.Messaging10dlc.PhoneNumberCampaigns.List(context.TODO(), telnyx.Messaging10dlcPhoneNumberCampaignListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
POST /10dlc/phone_number_campaigns — Required: phoneNumber, campaignId
phoneNumberCampaign, err := client.Messaging10dlc.PhoneNumberCampaigns.New(context.TODO(), telnyx.Messaging10dlcPhoneNumberCampaignNewParams{
PhoneNumberCampaignCreate: telnyx.PhoneNumberCampaignCreateParam{
CampaignID: "4b300178-131c-d902-d54e-72d90ba1620j",
PhoneNumber: "+18005550199",
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", phoneNumberCampaign.CampaignID)
Retrieve an individual phone number/campaign assignment by phoneNumber.
GET /10dlc/phone_number_campaigns/{phoneNumber}
phoneNumberCampaign, err := client.Messaging10dlc.PhoneNumberCampaigns.Get(context.TODO(), "phoneNumber")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", phoneNumberCampaign.CampaignID)
PUT /10dlc/phone_number_campaigns/{phoneNumber} — Required: phoneNumber, campaignId
phoneNumberCampaign, err := client.Messaging10dlc.PhoneNumberCampaigns.Update(
context.TODO(),
"phoneNumber",
telnyx.Messaging10dlcPhoneNumberCampaignUpdateParams{
PhoneNumberCampaignCreate: telnyx.PhoneNumberCampaignCreateParam{
CampaignID: "4b300178-131c-d902-d54e-72d90ba1620j",
PhoneNumber: "+18005550199",
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", phoneNumberCampaign.CampaignID)
This endpoint allows you to remove a campaign assignment from the supplied phoneNumber.
DELETE /10dlc/phone_number_campaigns/{phoneNumber}
phoneNumberCampaign, err := client.Messaging10dlc.PhoneNumberCampaigns.Delete(context.TODO(), "phoneNumber")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", phoneNumberCampaign.CampaignID)
This endpoint allows you to link all phone numbers associated with a Messaging Profile to a campaign.
POST /10dlc/phoneNumberAssignmentByProfile — Required: messagingProfileId
response, err := client.Messaging10dlc.PhoneNumberAssignmentByProfile.Assign(context.TODO(), telnyx.Messaging10dlcPhoneNumberAssignmentByProfileAssignParams{
MessagingProfileID: "4001767e-ce0f-4cae-9d5f-0d5e636e7809",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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}
response, err := client.Messaging10dlc.PhoneNumberAssignmentByProfile.GetStatus(context.TODO(), "taskId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Status)
Check the status of the individual phone number/campaign assignments associated with the supplied taskId.
GET /10dlc/phoneNumberAssignmentByProfile/{taskId}/phoneNumbers
response, err := client.Messaging10dlc.PhoneNumberAssignmentByProfile.ListPhoneNumberStatus(
context.TODO(),
"taskId",
telnyx.Messaging10dlcPhoneNumberAssignmentByProfileListPhoneNumberStatusParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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 |