Skill: teamtelnyx/telnyx-10dlc (version 1.0.0)

--- name: 10dlc-registration description: Register for 10DLC as a sole proprietor to enable SMS messaging in the USA. Use when setting up A2P SMS, registering brands/campaigns, or assigning phone numbers for compliant US messaging. Requires Telnyx CLI. metadata: {"openclaw":{"emoji":"📱","requires":{"bins":["telnyx"],"env":["TELNYX_API_KEY"]},"primaryEnv":"TELNYX_API_KEY"}} --- # 10DLC Registration Register for 10DLC (10-Digit Long Code) to enable A2P SMS in the USA. ## Quick Start with Scripts ```bash # Interactive registration wizard ./scripts/register.sh # Check status of brands/campaigns ./scripts/status.sh # Assign a phone number to a campaign ./scripts/assign.sh +15551234567 <campaign-id> ``` ## Prerequisites - Telnyx CLI installed: `npm install -g @telnyx/api-cli` - API key configured: `telnyx auth setup` - At least one US phone number ## Quick Start Interactive wizard (easiest): ```bash telnyx 10dlc wizard ``` ## Manual Registration ### Step 1: Create Sole Proprietor Brand ```bash telnyx 10dlc brand create --sole-prop \ --display-name "Your Business Name" \ --phone +15551234567 \ --email [REDACTED_SECRET] ``` ### Step 2: Verify Brand (if required) ```bash telnyx 10dlc brand get <brand-id> telnyx 10dlc brand verify <brand-id> --pin 123456 ``` ### Step 3: Create Campaign ```bash telnyx 10dlc campaign create \ --brand-id <brand-id> \ --usecase CUSTOMER_CARE \ --description "Customer notifications and support" \ --sample-message-1 "Your order #12345 has shipped." \ --sample-message-2 "Reply STOP to opt out." ``` ### Step 4: Assign Phone Number ```bash telnyx 10dlc assign +15551234567 <campaign-id> ``` ### Step 5: Wait for Approval ```bash telnyx 10dlc campaign get <campaign-id> ``` ## Use Cases | Use Case | Description | |----------|-------------| | `2FA` | Auth codes | | `CUSTOMER_CARE` | Support messages | | `ACCOUNT_NOTIFICATION` | Account alerts | | `DELIVERY_NOTIFICATION` | Shipping updates | | `MIXED` | Multiple purposes | List all: `telnyx 10dlc usecases` ## Status Commands ```bash telnyx 10dlc brand list telnyx 10dlc campaign list telnyx 10dlc assignment status +15551234567 ``` ## Troubleshooting ### Common Errors | Error | Cause | Solution | |-------|-------|----------| | `Brand verification required` | Sole proprietor brands need phone verification | Check email/SMS for PIN, run `telnyx 10dlc brand verify <id> --pin <code>` | | `Campaign rejected: insufficient description` | Description too vague | Be specific about message purpose, include business context | | `Sample messages must include opt-out` | Missing STOP instructions | Add "Reply STOP to unsubscribe" to sample messages | | `Phone number already assigned` | Number linked to another campaign | Run `telnyx 10dlc unassign +1...` first | | `Brand pending` | Still under review (24-72h typical) | Wait and check status with `telnyx 10dlc brand get <id>` | | `Invalid use case for sole proprietor` | Some use cases restricted | Sole prop limited to: 2FA, CUSTOMER_CARE, DELIVERY_NOTIFICATION, ACCOUNT_NOTIFICATION | | `Rate limit exceeded` | Too many API calls | Wait 60s and retry | ### Debug Tips ```bash # Verbose output for debugging telnyx 10dlc brand get <id> --json # Check number assignment status telnyx 10dlc assignment status +15551234567 # List all campaigns with details telnyx 10dlc campaign list --json | jq '.data[] | {id, status, usecase}' ``` ### Timeline Expectations | Step | Typical Time | |------|--------------| | Brand creation | Instant | | Brand verification | 1-5 minutes (PIN via SMS/email) | | Brand approval | 24-72 hours | | Campaign review | 24-48 hours | | Number assignment | Instant (after campaign approved) | ### Getting Help - Telnyx docs: https://developers.telnyx.com/docs/messaging/10dlc - Support portal: https://support.telnyx.com - API status: https://status.telnyx.com ## Pricing Brand and campaign registration: **Free**

path: config.json
content: {
  "description": "10DLC Registration Skill Configuration",
  "registration": {
    "brand_type": "SOLE_PROPRIETOR",
    "vertical": "COMMUNICATION",
    "use_cases": ["2FA", "CUSTOMER_CARE", "ACCOUNT_NOTIFICATION", "DELIVERY_NOTIFICATION"]
  },
  "cli": {
    "timeout_seconds": 120
  }
}


path: scripts/assign.sh
content: #!/bin/bash
# Assign a phone number to a 10DLC campaign
set -euo pipefail

# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'

usage() {
    echo "Usage: $0 <phone-number> <campaign-id>"
    echo ""
    echo "Examples:"
    echo "  $0 +15551234567 abc123-def456"
    echo "  $0 +15551234567 --list    # List available campaigns"
    exit 1
}

if [ $# -lt 1 ]; then
    usage
fi

PHONE="${1:-}"
CAMPAIGN="${2:-}"

if ! command -v telnyx &>/dev/null; then
    echo -e "${RED}Error: Telnyx CLI not installed${NC}"
    exit 1
fi

# List campaigns if requested
if [ "$PHONE" = "--list" ] || [ "$CAMPAIGN" = "--list" ]; then
    echo -e "${GREEN}Available campaigns:${NC}"
    telnyx 10dlc campaign list
    exit 0
fi

if [ -z "$CAMPAIGN" ]; then
    echo -e "${RED}Error: Campaign ID required${NC}"
    echo ""
    echo "Available campaigns:"
    telnyx 10dlc campaign list 2>/dev/null || echo "  (none found)"
    echo ""
    usage
fi

# Validate phone format
if [[ ! "$PHONE" =~ ^\+1[0-9]{10}$ ]]; then
    echo -e "${YELLOW}Warning: Phone number should be in E.164 format (+15551234567)${NC}"
fi

echo -e "${GREEN}📱 Assigning Number to Campaign${NC}"
echo "======================================"
echo "Phone:    $PHONE"
echo "Campaign: $CAMPAIGN"
echo ""

# Check current status
echo "Current assignment status:"
telnyx 10dlc assignment status "$PHONE" 2>/dev/null || echo "  (not assigned)"
echo ""

read -p "Proceed with assignment? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
    echo "Cancelled."
    exit 0
fi

# Assign
if telnyx 10dlc assign "$PHONE" "$CAMPAIGN"; then
    echo ""
    echo -e "${GREEN}✅ Assignment submitted!${NC}"
    echo ""
    echo "Check status with: telnyx 10dlc assignment status $PHONE"
else
    echo ""
    echo -e "${RED}❌ Assignment failed${NC}"
    exit 1
fi


path: scripts/register.sh
content: #!/bin/bash
# 10DLC Registration Script
# Wraps 'telnyx 10dlc wizard' with checks and guidance
set -euo pipefail

# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'

echo -e "${GREEN}📱 10DLC Registration${NC}"
echo "======================================"

# Check prerequisites
if ! command -v telnyx &>/dev/null; then
    echo -e "${RED}Error: Telnyx CLI not installed${NC}"
    echo "Install with: npm install -g @telnyx/api-cli"
    exit 1
fi

# Check auth
if ! telnyx auth status &>/dev/null; then
    echo -e "${YELLOW}Telnyx CLI not configured. Running setup...${NC}"
    telnyx auth setup
fi

echo ""
echo "This wizard will help you register for 10DLC (A2P SMS in the USA)."
echo ""
echo -e "${YELLOW}You'll need:${NC}"
echo "  • Business name (or personal name for sole proprietor)"
echo "  • Contact phone number"
echo "  • Contact email"
echo "  • Description of your SMS use case"
echo "  • 2 sample messages"
echo ""
read -p "Press Enter to continue or Ctrl+C to cancel..."

# Check for existing registrations
echo ""
echo -e "${GREEN}Checking existing registrations...${NC}"
BRANDS=$(telnyx 10dlc brand list --format json 2>/dev/null || echo "[]")
if [ "$BRANDS" != "[]" ] && [ -n "$BRANDS" ]; then
    echo -e "${YELLOW}You have existing brands:${NC}"
    telnyx 10dlc brand list
    echo ""
    read -p "Continue with new registration? (y/N) " -n 1 -r
    echo
    if [[ ! $REPLY =~ ^[Yy]$ ]]; then
        echo "Use 'telnyx 10dlc campaign create' to add a campaign to an existing brand."
        exit 0
    fi
fi

# Run the wizard
echo ""
echo -e "${GREEN}Starting 10DLC registration wizard...${NC}"
echo ""
telnyx 10dlc wizard

echo ""
echo -e "${GREEN}✅ Registration submitted!${NC}"
echo ""
echo "Next steps:"
echo "  1. Check status:  ./status.sh"
echo "  2. Assign number: ./assign.sh +15551234567 <campaign-id>"
echo ""
echo "Note: Approval typically takes 1-3 business days."


path: scripts/status.sh
content: #!/bin/bash
# 10DLC Status Check
# Shows all brands, campaigns, and number assignments
set -euo pipefail

# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'

echo -e "${GREEN}📱 10DLC Status${NC}"
echo "======================================"

if ! command -v telnyx &>/dev/null; then
    echo "Error: Telnyx CLI not installed"
    exit 1
fi

# Brands
echo ""
echo -e "${BLUE}Brands:${NC}"
if ! telnyx 10dlc brand list 2>/dev/null; then
    echo "  No brands found (or CLI not authenticated)"
fi

# Campaigns
echo ""
echo -e "${BLUE}Campaigns:${NC}"
if ! telnyx 10dlc campaign list 2>/dev/null; then
    echo "  No campaigns found"
fi

# Check specific brand/campaign if provided
if [ -n "${1:-}" ]; then
    echo ""
    echo -e "${BLUE}Details for: $1${NC}"
    # Try as brand first, then campaign
    if telnyx 10dlc brand get "$1" 2>/dev/null; then
        :
    elif telnyx 10dlc campaign get "$1" 2>/dev/null; then
        :
    else
        echo "  Not found as brand or campaign ID"
    fi
fi

echo ""
echo -e "${YELLOW}Tip:${NC} Check a specific number with: telnyx 10dlc assignment status +15551234567"


path: setup.sh
content: #!/bin/bash
# Setup script for 10dlc-registration skill
# Installs prerequisites and configures the skill

set -e

echo "🔧 10DLC Registration - Setup"
echo "============================="

# Function to install Telnyx CLI
install_telnyx_cli() {
    echo "📦 Installing Telnyx CLI..."
    if command -v npm &> /dev/null; then
        npm install -g @telnyx/api-cli
    else
        echo "❌ npm not found. Install Node.js first:"
        echo "   macOS: brew install node"
        echo "   Ubuntu: sudo apt install nodejs npm"
        return 1
    fi
}

# Check Telnyx CLI
echo "1. Checking Telnyx CLI..."
if ! command -v telnyx &> /dev/null; then
    echo "   Telnyx CLI not found."
    read -p "   Install Telnyx CLI? [Y/n] " -n 1 -r
    echo
    if [[ $REPLY =~ ^[Yy]$ ]] || [[ -z $REPLY ]]; then
        install_telnyx_cli
    else
        echo "   ⚠️  Telnyx CLI required for this skill"
        exit 1
    fi
else
    echo "   ✅ Telnyx CLI found"
fi

# Check Telnyx auth
echo ""
echo "2. Checking Telnyx authentication..."
if ! telnyx auth status &> /dev/null; then
    echo "   Telnyx CLI not authenticated."
    read -p "   Run 'telnyx auth setup' now? [Y/n] " -n 1 -r
    echo
    if [[ $REPLY =~ ^[Yy]$ ]] || [[ -z $REPLY ]]; then
        echo ""
        echo "   Get your API key from: https://portal.telnyx.com/#/app/api-keys"
        echo ""
        telnyx auth setup
    else
        echo "   ⚠️  Run 'telnyx auth setup' before using this skill"
    fi
else
    echo "   ✅ Telnyx CLI authenticated"
fi

# Check 10DLC access
echo ""
echo "3. Checking 10DLC API access..."
if telnyx 10dlc brand list &> /dev/null; then
    echo "   ✅ 10DLC API accessible"
    
    # Show current brands if any
    BRANDS=$(telnyx 10dlc brand list --json 2>/dev/null | grep -c '"id"' || echo "0")
    if [[ "$BRANDS" -gt 0 ]]; then
        echo "   📋 You have $BRANDS brand(s) registered"
    else
        echo "   📭 No brands registered yet"
    fi
else
    echo "   ❌ 10DLC API not accessible. Check authentication."
fi

# Check for US phone numbers
echo ""
echo "4. Checking for US phone numbers..."
US_NUMBERS=$(telnyx number list --json 2>/dev/null | grep -E '"\+1[0-9]{10}"' | head -5 || echo "")
if [[ -n "$US_NUMBERS" ]]; then
    echo "   ✅ US phone numbers found"
else
    echo "   ⚠️  No US phone numbers found"
    echo "   You'll need at least one US number for 10DLC registration"
    echo "   Search: telnyx number search --country US"
fi

# Make scripts executable
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
chmod +x "$SCRIPT_DIR/scripts/"*.sh 2>/dev/null || true

echo ""
echo "============================="
echo "✅ Setup complete!"
echo ""
echo "Usage:"
echo "  $SCRIPT_DIR/scripts/register.sh  # Start 10DLC wizard"
echo "  $SCRIPT_DIR/scripts/status.sh    # Check brand/campaign status"
echo "  $SCRIPT_DIR/scripts/assign.sh    # Assign number to campaign"


path: test.sh
content: #!/bin/bash
# Test script for 10dlc-registration skill
# Verifies CLI, auth, and basic operations

set -e

echo "🧪 10DLC Registration - Tests"
echo "============================="

PASS=0
FAIL=0

test_result() {
    if [ $1 -eq 0 ]; then
        echo "  ✅ $2"
        PASS=$((PASS + 1))
    else
        echo "  ❌ $2"
        FAIL=$((FAIL + 1))
    fi
}

# Test 1: CLI installed
echo ""
echo "1. Checking Telnyx CLI..."
command -v telnyx &> /dev/null
test_result $? "Telnyx CLI installed"

# Test 2: CLI authenticated
echo ""
echo "2. Checking authentication..."
telnyx auth status &> /dev/null
test_result $? "Telnyx CLI authenticated"

# Test 3: 10DLC commands available
echo ""
echo "3. Checking 10DLC support..."
telnyx 10dlc --help &> /dev/null
test_result $? "10DLC commands available"

# Test 4: Can list brands (API access)
echo ""
echo "4. Checking 10DLC API access..."
telnyx 10dlc brand list &> /dev/null
test_result $? "10DLC API accessible"

# Test 5: Scripts exist and are executable
echo ""
echo "5. Checking scripts..."
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
[ -x "$SCRIPT_DIR/scripts/register.sh" ]
test_result $? "register.sh executable"
[ -x "$SCRIPT_DIR/scripts/status.sh" ]
test_result $? "status.sh executable"
[ -x "$SCRIPT_DIR/scripts/assign.sh" ]
test_result $? "assign.sh executable"

# Summary
echo ""
echo "============================="
echo "Results: $PASS passed, $FAIL failed"

if [ $FAIL -gt 0 ]; then
    exit 1
fi


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)