$npx -y skills add team-telnyx/ai --skill telnyx-10dlc-curl10DLC brand and campaign registration for US A2P messaging compliance. Assign phone numbers to campaigns.
| 1 | <!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. --> |
| 2 | |
| 3 | # Telnyx 10DLC - curl |
| 4 | |
| 5 | ## Installation |
| 6 | |
| 7 | ```text |
| 8 | # curl is pre-installed on macOS, Linux, and Windows 10+ |
| 9 | ``` |
| 10 | |
| 11 | ## Setup |
| 12 | |
| 13 | ```bash |
| 14 | export TELNYX_API_KEY="YOUR_API_KEY_HERE" |
| 15 | ``` |
| 16 | |
| 17 | All examples below use `$TELNYX_API_KEY` for authentication. |
| 18 | |
| 19 | ## Error Handling |
| 20 | |
| 21 | All API calls can fail with network errors, rate limits (429), validation errors (422), |
| 22 | or authentication errors (401). Always handle errors in production code: |
| 23 | |
| 24 | ```bash |
| 25 | curl \ |
| 26 | -X POST \ |
| 27 | -H "Authorization: Bearer $TELNYX_API_KEY" \ |
| 28 | -H "Content-Type: application/json" \ |
| 29 | -d '{ |
| 30 | "entityType": "PRIVATE_PROFIT", |
| 31 | "displayName": "ABC Mobile", |
| 32 | "country": "US", |
| 33 | "email": "support@example.com", |
| 34 | "vertical": "TECHNOLOGY" |
| 35 | }' \ |
| 36 | "https://api.telnyx.com/v2/10dlc/brand" |
| 37 | ``` |
| 38 | |
| 39 | Common error codes: `401` invalid API key, `403` insufficient permissions, |
| 40 | `404` resource not found, `422` validation error (check field formats), |
| 41 | `429` rate limited (retry with exponential backoff). |
| 42 | |
| 43 | ## Important Notes |
| 44 | |
| 45 | - **Pagination:** List endpoints return paginated results. Use `page[number]` and `page[size]` query parameters to navigate pages. Check `meta.total_pages` in the response. |
| 46 | |
| 47 | ## Operational Caveats |
| 48 | |
| 49 | - 10DLC is sequential: create the brand first, then submit the campaign, then attach messaging infrastructure such as the messaging profile. |
| 50 | - Registration calls are not enough by themselves. Messaging cannot use the campaign until the assignment step completes successfully. |
| 51 | - Treat registration status fields as part of the control flow. Do not assume the campaign is send-ready until the returned status fields confirm it. |
| 52 | |
| 53 | ## Reference Use Rules |
| 54 | |
| 55 | Do not invent Telnyx parameters, enums, response fields, or webhook fields. |
| 56 | |
| 57 | - If the parameter, enum, or response field you need is not shown inline in this skill, read [references/api-details.md](references/api-details.md) before writing code. |
| 58 | - Before using any operation in `## Additional Operations`, read [the optional-parameters section](references/api-details.md#optional-parameters) and [the response-schemas section](references/api-details.md#response-schemas). |
| 59 | - Before reading or matching webhook fields beyond the inline examples, read [the webhook payload reference](references/api-details.md#webhook-payload-fields). |
| 60 | |
| 61 | ## Core Tasks |
| 62 | |
| 63 | ### Create a brand |
| 64 | |
| 65 | Brand registration is the entrypoint for any US A2P 10DLC campaign flow. |
| 66 | |
| 67 | `POST /10dlc/brand` |
| 68 | |
| 69 | | Parameter | Type | Required | Description | |
| 70 | |-----------|------|----------|-------------| |
| 71 | | `entityType` | object | Yes | Entity type behind the brand. | |
| 72 | | `displayName` | string | Yes | Display name, marketing name, or DBA name of the brand. | |
| 73 | | `country` | string | Yes | ISO2 2 characters country code. | |
| 74 | | `email` | string | Yes | Valid email address of brand support contact. | |
| 75 | | `vertical` | object | Yes | Vertical or industry segment of the brand. | |
| 76 | | `companyName` | string | No | (Required for Non-profit/private/public) Legal company name. | |
| 77 | | `firstName` | string | No | First name of business contact. | |
| 78 | | `lastName` | string | No | Last name of business contact. | |
| 79 | | ... | | | +16 optional params in [references/api-details.md](references/api-details.md) | |
| 80 | |
| 81 | ```bash |
| 82 | curl \ |
| 83 | -X POST \ |
| 84 | -H "Authorization: Bearer $TELNYX_API_KEY" \ |
| 85 | -H "Content-Type: application/json" \ |
| 86 | -d '{ |
| 87 | "entityType": "PRIVATE_PROFIT", |
| 88 | "displayName": "ABC Mobile", |
| 89 | "country": "US", |
| 90 | "email": "support@example.com", |
| 91 | "vertical": "TECHNOLOGY" |
| 92 | }' \ |
| 93 | "https://api.telnyx.com/v2/10dlc/brand" |
| 94 | ``` |
| 95 | |
| 96 | Primary response fields: |
| 97 | - `.data.brandId` |
| 98 | - `.data.identityStatus` |
| 99 | - `.data.status` |
| 100 | - `.data.displayName` |
| 101 | - `.data.state` |
| 102 | - `.data.altBusinessId` |
| 103 | |
| 104 | ### Submit a campaign |
| 105 | |
| 106 | Campaign submission is the compliance-critical step that determines whether traffic can be provisioned. |
| 107 | |
| 108 | `POST /10dlc/campaignBuilder` |
| 109 | |
| 110 | | Parameter | Type | Required | Description | |
| 111 | |-----------|------|----------|-------------| |
| 112 | | `brandId` | string (UUID) | Yes | Alphanumeric identifier of the brand associated with this ca... | |
| 113 | | `description` | string | Yes | Summary description of this campaign. | |
| 114 | | `usecase` | string | Yes | Campaign usecase. | |
| 115 | | `ageGated` | boolean | No | Age gated message content in campaign. | |
| 116 | | `autoRenewal` | boolean | No | Campaign subscription auto-renewal option. | |
| 117 | | `directLending` | boolean | No | Direct lending or loan arrangement | |
| 118 | | ... | | | +29 optional params in [references/api-details.md](references/api-details.md) | |
| 119 | |
| 120 | ```bash |
| 121 | curl \ |
| 122 | -X POST \ |
| 123 | -H "Authorization: Bearer $TELNYX_API_KEY" \ |
| 124 | -H "Content-Type: application/json" \ |
| 125 | -d '{ |
| 126 | "brandId": "BXXXXXX", |
| 127 | "description": "Two-factor authentication messages", |
| 128 | "usecase": "2FA", |
| 129 | "sample1 |