Skip to main content
After your brand is registered and campaign is approved, you need to assign phone numbers to the campaign before sending messages. Only numbers assigned to an active campaign can send 10DLC A2P messages.

How it works

RequirementDetails
Number typeUS long code (10-digit) numbers only
Messaging profileNumber must be assigned to a messaging profile first
Campaign statusCampaign must be ACTIVE (approved by carriers)
One campaign per numberEach number can only be assigned to one campaign at a time
Numbers not assigned to an active 10DLC campaign will have messages filtered or blocked by carriers on AT&T, T-Mobile, and other major US networks.

Assign a number to a campaign

curl -X POST https://api.telnyx.com/v2/10dlc/phoneNumberCampaign \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "phoneNumber": "+15551234567",
    "campaignId": "CAMPAIGN_ID"
  }'

Bulk assignment

When assigning multiple numbers to the same campaign, loop through your numbers programmatically:
import os
import requests
import time

API_KEY = os.environ.get("TELNYX_API_KEY")
headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json",
}

campaign_id = "CAMPAIGN_ID"
phone_numbers = [
    "+15551234567",
    "+15551234568",
    "+15551234569",
    "+15551234570",
    "+15551234571",
]

results = {"success": [], "failed": []}

for number in phone_numbers:
    try:
        response = requests.post(
            "https://api.telnyx.com/v2/10dlc/phoneNumberCampaign",
            headers=headers,
            json={"phoneNumber": number, "campaignId": campaign_id},
        )
        if response.status_code in (200, 201):
            results["success"].append(number)
            print(f"✓ {number} assigned")
        else:
            error = response.json().get("errors", [{}])[0].get("detail", "Unknown")
            results["failed"].append({"number": number, "error": error})
            print(f"✗ {number}: {error}")
    except Exception as e:
        results["failed"].append({"number": number, "error": str(e)})
    time.sleep(0.5)  # Rate limit safety

print(f"\nAssigned: {len(results['success'])}, Failed: {len(results['failed'])}")

Number pool integration

If you’re using Number Pools, numbers in the pool must also be assigned to a 10DLC campaign. The number pool distributes sending across multiple numbers, but each number still needs campaign registration.
1

Create your campaign

Register your campaign via the Campaign Registration guide.
2

Enable number pool on messaging profile

Configure your messaging profile with number pool enabled.
3

Assign all pool numbers to the campaign

Every number in the pool must be assigned to the same campaign. Use the bulk assignment method above.
4

Verify assignments

List all numbers assigned to your campaign to confirm all pool numbers are included.
If a number in your pool is not assigned to a campaign, messages sent from that number will be filtered by carriers. This creates inconsistent delivery — some messages succeed, others fail depending on which pool number is selected.

List assigned numbers

# List all numbers assigned to a campaign
curl -s "https://api.telnyx.com/v2/10dlc/phoneNumberCampaign?filter[campaignId]=CAMPAIGN_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" | jq '.data[] | {phoneNumber, status}'

Remove a number from a campaign

curl -X DELETE "https://api.telnyx.com/v2/10dlc/phoneNumberCampaign/+15551234567" \
  -H "Authorization: Bearer YOUR_API_KEY"
Removing a number from a campaign means it can no longer send 10DLC messages. You can reassign it to a different campaign afterward.

Troubleshooting

Cause: The phone number isn’t on your Telnyx account or isn’t in E.164 format.Fix:
  • Verify the number is in your account: GET /v2/phone_numbers?filter[phone_number]=+15551234567
  • Ensure E.164 format: +1 followed by 10 digits (e.g., +15551234567)
Cause: Numbers must be assigned to a messaging profile before campaign assignment.Fix:
# Assign number to a messaging profile first
curl -X PATCH https://api.telnyx.com/v2/phone_numbers/+15551234567 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"messaging_profile_id": "PROFILE_ID"}'
Cause: The campaign hasn’t been approved by carriers yet.Fix:
  • Check campaign status: GET /v2/10dlc/campaignBuilder/{campaignId}
  • Wait for carrier approval (1-5 business days)
  • Set up Event Notifications to get notified when the campaign is approved
Cause: Each number can only be assigned to one campaign at a time.Fix:
  1. Remove the number from the current campaign: DELETE /v2/10dlc/phoneNumberCampaign/+15551234567
  2. Assign it to the new campaign
Cause: Carrier provisioning takes time after assignment.Fix:
  • Wait 24-72 hours for all carriers to propagate
  • Check MNO metadata on the campaign for per-carrier status
  • Verify the number is sending the same type of content registered in the campaign
  • Check Message Detail Records for specific error codes
Cause: Some numbers may have issues while others succeed.Fix:
  • Check each error response for the specific reason
  • Common issues: number on different account, already assigned, not on messaging profile
  • Use the bulk assignment script above with error tracking to identify which numbers failed and why

Next steps