Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Send WhatsApp messages, manage templates, WABAs, and phone numbers via the Telnyx WhatsApp Business API.
.claude/skills/team-telnyx-telnyx-whatsapp-curl/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 242% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 407% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 300% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 275% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 268% | 0% |
text# curl is pre-installed on macOS, Linux, and Windows 10+
bashexport TELNYX_API_KEY="YOUR_API_KEY_HERE"
All examples below use $TELNYX_API_KEY for authentication.
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
bashcurl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from": "+19452940762", "to": "+18005551234", "type": "WHATSAPP", "whatsapp_message": { "type": "text", "text": { "body": "Hello from Telnyx!" } } }' \ "https://api.telnyx.com/v2/messages/whatsapp"
Common error codes: 401 invalid API key, 403 insufficient permissions, 404 resource not found, 422 validation error (check field formats), 429 rate limited (retry with exponential backoff).
+13125550001). Include the + prefix and country code.template_id) instead of name + language. When template_id is provided, name and language are resolved automatically.whatsapp_marketing, whatsapp_utility, whatsapp_authentication, or whatsapp_authentication_international based on category and destination.APPROVED status before they can be used for sending.order_confirmation). No spaces, hyphens, or uppercase.AUTHENTICATION templates get special pricing but must contain an OTP. UTILITY is for transactional messages. MARKETING for promotional content.Do not invent Telnyx parameters, enums, response fields, or webhook fields.
## Additional Operations, read the optional-parameters section and the response-schemas section.Send a pre-approved template message. Templates can be sent anytime — no 24-hour window restriction.
POST /messages/whatsapp
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | from | string (E.164) | Yes | WhatsApp-enabled phone number in +E.164 format | | to | string (E.164) | Yes | Recipient phone number in +E.164 format | | type | string | No | Must be WHATSAPP | | whatsapp_message.type | string | Yes | Must be template | | whatsapp_message.template.name | string | Yes | Template name (e.g., `order_confirmation`) | | `whatsapp_message.template.language.code` | string | Yes | Language code (e.g., en_US) | | whatsapp_message.template.template_id | string (UUID) | No | Telnyx template UUID. If provided, name and language are resolved from DB | | whatsapp_message.template.components | array | No | Template parameter values | | messaging_profile_id | string (UUID) | No | Messaging profile to use | | webhook_url | string (URL) | No | Callback URL for delivery status updates |
Required unless template_id is provided.
bash# Send by template name + language curl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from": "+19452940762", "to": "+18005551234", "type": "WHATSAPP", "whatsapp_message": { "type": "template", "template": { "name": "order_confirmation", "language": { "code": "en_US" }, "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "ORD-12345" }, { "type": "text", "text": "March 15, 2026" } ] } ] } } }' \ "https://api.telnyx.com/v2/messages/whatsapp"
bash# Send by Telnyx template_id (no name/language needed) curl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from": "+19452940762", "to": "+18005551234", "type": "WHATSAPP", "whatsapp_message": { "type": "template", "template": { "template_id": "019cd44b-3a1c-781b-956e-bd33e9fd2ac6", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "483291" } ] } ] } } }' \ "https://api.telnyx.com/v2/messages/whatsapp"
Primary response fields:
.data.id — Message UUID.data.to[0].status — queued, sent, delivered, failed.data.from.phone_number.data.type — WHATSAPPSend a text message within the 24-hour customer service window (customer must have messaged you first).
POST /messages/whatsapp
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | from | string (E.164) | Yes | WhatsApp-enabled phone number | | to | string (E.164) | Yes | Recipient phone number | | whatsapp_message.type | string | Yes | text | | whatsapp_message.text.body | string | Yes | Message content |
bashcurl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from": "+19452940762", "to": "+18005551234", "type": "WHATSAPP", "whatsapp_message": { "type": "text", "text": { "body": "Your order has shipped!" } } }' \ "https://api.telnyx.com/v2/messages/whatsapp"
Retrieve all WABAs associated with your Telnyx account.
GET /v2/whatsapp/business_accounts
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | page[number] | integer | No | Page number (default: 1) | | page[size] | integer | No | Page size (default: 20) |
bashcurl \ -H "Authorization: Bearer $TELNYX_API_KEY" \ "https://api.telnyx.com/v2/whatsapp/business_accounts"
Primary response fields:
.data[].id — Telnyx WABA UUID.data[].waba_id — Meta WABA ID.data[].name — Business name.data[].status — Account status.data[].country — WABA countryRetrieve message templates, optionally filtered by WABA.
GET /v2/whatsapp/message_templates
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | waba_id | string (UUID) | No | Filter by Telnyx WABA UUID (query parameter) | | category | string | No | Filter by category: AUTHENTICATION, MARKETING, UTILITY | | status | string | No | Filter by status: APPROVED, PENDING, REJECTED, DISABLED | | page[number] | integer | No | Page number | | page[size] | integer | No | Page size |
bashcurl \ -H "Authorization: Bearer $TELNYX_API_KEY" \ "https://api.telnyx.com/v2/whatsapp/message_templates?waba_id=019c1ff0-5c30-7f36-8436-730b1d0b0e56&status=APPROVED"
Primary response fields:
.data[].id — Telnyx template UUID (use this as template_id when sending).data[].name — Template name.data[].category — AUTHENTICATION, MARKETING, or UTILITY.data[].language — Language code (e.g., en_US).data[].status — APPROVED, PENDING, REJECTED, DISABLED.data[].components — Template components (header, body, footer, buttons)Submit a new template for Meta review. Templates typically take minutes to hours for approval.
POST /v2/whatsapp/message_templates
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | waba_id | string (UUID) | Yes | Telnyx WABA UUID (body parameter) | | name | string | Yes | Lowercase with underscores only (e.g., order_update) | | category | string | Yes | AUTHENTICATION, MARKETING, or UTILITY | | language | string | Yes | Language code (e.g., en_US) | | components | array | Yes | Template components |
bashcurl \ -X POST \ -H "Authorization: Bearer $TELNYX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "waba_id": "019c1ff0-5c30-7f36-8436-730b1d0b0e56", "name": "order_shipped", "category": "UTILITY", "language": "en_US", "components": [ { "type": "BODY", "text": "Your order {{1}} has been shipped and will arrive by {{2}}.", "example": { "body_text": [["ORD-12345", "March 20, 2026"]] } } ] }' \ "https://api.telnyx.com/v2/whatsapp/message_templates"
Primary response fields:
.data.id — Telnyx template UUID.data.name — Template name.data.status — Initially PENDING until Meta approvesGET /v2/whatsapp/phone_numbers
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | waba_id | string (UUID) | No | Filter by Telnyx WABA UUID (query parameter) |
bashcurl \ -H "Authorization: Bearer $TELNYX_API_KEY" \ "https://api.telnyx.com/v2/whatsapp/phone_numbers?waba_id=019c1ff0-5c30-7f36-8436-730b1d0b0e56"
Primary response fields:
.data[].phone_number — Phone number in E.164 format.data[].number_id — Meta phone number ID.data[].quality_rating — GREEN, YELLOW, or RED.data[].messaging_limit_tier — Current messaging tierTelnyx signs webhooks with Ed25519. Each request includes telnyx-signature-ed25519 and telnyx-timestamp headers. Always verify signatures in production.
These webhook payload fields are inline because they are part of the primary integration path.
| Field | Type | Description | |-------|------|-------------| | data.event_type | enum: message.sent, message.finalized | Delivery status event | | data.payload.id | uuid | Message ID | | data.payload.to[0].status | string | queued, sent, delivered, read, failed | | data.payload.template_id | string | Telnyx template UUID (if template message) | | data.payload.template_name | string | Template name (if template message) | | data.payload.cost | object | Cost information | | data.payload.errors | array | Error details if failed |
Configure webhook events on your WABA to receive template lifecycle notifications.
| Field | Type | Description | |-------|------|-------------| | event_type | string | whatsapp.template.approved, whatsapp.template.rejected, whatsapp.template.disabled | | payload.template_id | string | Telnyx template UUID | | payload.template_name | string | Template name | | payload.status | string | New template status | | payload.reason | string | Rejection/disable reason (if applicable) | | payload.waba_id | string | WABA ID |
| Field | Type | Description | |-------|------|-------------| | event_type | string | whatsapp.phone_number.quality_changed | | payload.phone_number | string | Phone number in E.164 format | | payload.previous_quality_rating | string | Previous rating (GREEN, YELLOW, RED) | | payload.new_quality_rating | string | New rating |
appointment_reminder, not msg1).example field — Meta reviewers check these.AUTHENTICATION — OTP/verification codes only. Gets special pricing.UTILITY — Transactional (order updates, shipping, account alerts).MARKETING — Promotional content, offers, newsletters.{{1}}, {{2}}, etc. for variable content. Always provide the correct number of parameters when sending.| Operation | Endpoint | Use Case | |-----------|----------|----------| | Get template details | GET /v2/whatsapp_message_templates/{id} | Check template status, view components | | Get business profile | GET /v2/whatsapp/phone_numbers/{phone_number}/profile | View business display name, photo, description | | Configure WABA settings | PATCH /v2/whatsapp/business_accounts/{id}/settings | Subscribe to template/account events |
| Operation | Method | Endpoint | Use Case | Required Params | |-----------|--------|----------|----------|-----------------| | Send WhatsApp message | POST | /messages/whatsapp | Send template or free-form message | from, to, whatsapp_message | | List WABAs | GET | /v2/whatsapp/business_accounts | List all business accounts | — | | Get WABA | GET | /v2/whatsapp/business_accounts/{id} | Get WABA details | id | | List templates | GET | /v2/whatsapp/message_templates | List templates with filtering | — | | Get template | GET | /v2/whatsapp_message_templates/{id} | Get template details | id | | Create template | POST | /v2/whatsapp/message_templates | Create new template | waba_id, name, category, language, components | | List phone numbers | GET | /v2/whatsapp/phone_numbers | List WABA phone numbers | — | | Get business profile | GET | /v2/whatsapp/phone_numbers/{phone_number}/profile | View profile info | phone_number | | Update business profile | PATCH | /v2/whatsapp/phone_numbers/{phone_number}/profile | Update profile info | phone_number | | Get WABA settings | GET | /v2/whatsapp/business_accounts/{id}/settings | View WABA settings/webhook config | id | | Update WABA settings | PATCH | /v2/whatsapp/business_accounts/{id}/settings | Set webhook URL and events | id |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 8,478 | 5,856 | -31% | 1 | 1 | 0% | 1,747 | 5,979 | +242% | 0 | 0 | — |
case-02 | fail→pass | 17,339 | 5,476 | -68% | 1 | 1 | 0% | 1,138 | 5,770 | +407% | 0 | 0 | — |
case-03 | fail→pass | 6,582 | 3,733 | -43% | 1 | 1 | 0% | 1,347 | 5,390 | +300% | 0 | 0 | — |
case-04 | fail→pass | 7,567 | 7,447 | -2% | 1 | 1 | 0% | 1,696 | 6,362 | +275% | 0 | 0 | — |
case-05 | fail→pass | 7,042 | 3,879 | -45% | 1 | 1 | 0% | 1,480 | 5,453 | +268% | 0 | 0 | — |
case-06 | fail→fail | 6,457 | 6,357 | -2% | 1 | 1 | 0% | 1,355 | 5,918 | +337% | 0 | 0 | — |
case-07 | fail→pass | 5,266 | 3,178 | -40% | 1 | 1 | 0% | 1,052 | 5,136 | +388% | 0 | 0 | — |
case-08 | fail→pass | 5,585 | 3,391 | -39% | 1 | 1 | 0% | 1,166 | 5,295 | +354% | 0 | 0 | — |
case-09 | pass→pass | 5,866 | 4,353 | -26% | 1 | 1 | 0% | 1,159 | 5,524 | +377% | 0 | 0 | — |
case-10 | fail→pass | 5,835 | 2,167 | -63% | 1 | 1 | 0% | 1,028 | 5,053 | +392% | 0 | 0 | — |
case-11 | fail→pass | 11,314 | 6,523 | -42% | 1 | 1 | 0% | 2,325 | 5,987 | +158% | 0 | 0 | — |
case-12 | pass→pass | 9,560 | 7,016 | -27% | 1 | 1 | 0% | 1,777 | 5,964 | +236% | 0 | 0 | — |
case-13 | pass→pass | 10,250 | 5,192 | -49% | 1 | 1 | 0% | 1,747 | 5,579 | +219% | 0 | 0 | — |
case-14 | pass→pass | 6,322 | 3,094 | -51% | 1 | 1 | 0% | 1,170 | 5,263 | +350% | 0 | 0 | — |
case-15 | pass→pass | 3,301 | 2,277 | -31% | 1 | 1 | 0% | 520 | 5,039 | +869% | 0 | 0 | — |
case-16 | pass→pass | 6,438 | 1,920 | -70% | 1 | 1 | 0% | 1,079 | 4,964 | +360% | 0 | 0 | — |
case-17 | pass→pass | 7,783 | 3,484 | -55% | 1 | 1 | 0% | 1,182 | 5,278 | +347% | 0 | 0 | — |
case-18 | pass→pass | 4,322 | 5,015 | +16% | 1 | 1 | 0% | 860 | 5,807 | +575% | 0 | 0 | — |
case-19 | fail→pass | 7,238 | 6,967 | -4% | 1 | 1 | 0% | 1,417 | 6,102 | +331% | 0 | 0 | — |
case-20 | pass→pass | 9,387 | 5,279 | -44% | 1 | 1 | 0% | 1,573 | 5,592 | +255% | 0 | 0 | — |
case-21 | pass→pass | 3,202 | 6,260 | +96% | 1 | 1 | 0% | 703 | 5,544 | +689% | 0 | 0 | — |
case-22 | pass→pass | 8,324 | 7,607 | -9% | 1 | 1 | 0% | 1,825 | 6,322 | +246% | 0 | 0 | — |
case-23 | pass→pass | 3,490 | 2,903 | -17% | 1 | 1 | 0% | 829 | 5,183 | +525% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +43 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.