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-go/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 236% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 112% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 89% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 225% | 0% |
bashgo get github.com/team-telnyx/telnyx-go
goimport ( "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.
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
goctx := context.TODO() response, err := client.Messages.SendWhatsapp(ctx, telnyx.MessageSendWhatsappParams{ From: telnyx.String("+19452940762"), To: telnyx.String("+18005551234"), Type: telnyx.F(telnyx.MessageSendWhatsappParamsTypeWhatsapp), WhatsappMessage: telnyx.F(telnyx.MessageSendWhatsappParamsWhatsappMessage{ Type: telnyx.F("text"), Text: telnyx.F(map[string]interface{}{ "body": "Hello from Telnyx!", }), }), }) if err != nil { var apiErr *telnyx.Error if errors.As(err, &apiErr) { fmt.Printf("API error: %d - %s\n", apiErr.StatusCode, apiErr.Message) } return err } fmt.Println(response.Data.ID)
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.iter.Next() in a loop.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.
client.Messages.SendWhatsapp() — 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 | | WhatsappMessage | object | Yes | WhatsApp message object | | MessagingProfileID | string (UUID) | No | Messaging profile to use | | WebhookURL | string (URL) | No | Callback URL for delivery status updates |
go// Send by template name + language ctx := context.TODO() response, err := client.Messages.SendWhatsapp(ctx, telnyx.MessageSendWhatsappParams{ From: telnyx.String("+19452940762"), To: telnyx.String("+18005551234"), Type: telnyx.F(telnyx.MessageSendWhatsappParamsTypeWhatsapp), WhatsappMessage: telnyx.F(telnyx.MessageSendWhatsappParamsWhatsappMessage{ Type: telnyx.F("template"), Template: telnyx.F(telnyx.MessageSendWhatsappParamsWhatsappMessageTemplate{ Name: telnyx.String("order_confirmation"), Language: telnyx.F(telnyx.MessageSendWhatsappParamsWhatsappMessageTemplateLanguage{ Code: telnyx.String("en_US"), }), Components: telnyx.F([]telnyx.MessageSendWhatsappParamsWhatsappMessageTemplateComponent{ { Type: telnyx.F("body"), Parameters: telnyx.F([]telnyx.MessageSendWhatsappParamsWhatsappMessageTemplateComponentParameter{ {Type: telnyx.F("text"), Text: telnyx.String("ORD-12345")}, {Type: telnyx.F("text"), Text: telnyx.String("March 15, 2026")}, }), }, }), }), }), }) if err != nil { log.Fatal(err) } fmt.Println(response.Data.ID)
go// Send by Telnyx template_id (no name/language needed) ctx := context.TODO() response, err := client.Messages.SendWhatsapp(ctx, telnyx.MessageSendWhatsappParams{ From: telnyx.String("+19452940762"), To: telnyx.String("+18005551234"), Type: telnyx.F(telnyx.MessageSendWhatsappParamsTypeWhatsapp), WhatsappMessage: telnyx.F(telnyx.MessageSendWhatsappParamsWhatsappMessage{ Type: telnyx.F("template"), Template: telnyx.F(telnyx.MessageSendWhatsappParamsWhatsappMessageTemplate{ TemplateID: telnyx.String("019cd44b-3a1c-781b-956e-bd33e9fd2ac6"), Components: telnyx.F([]telnyx.MessageSendWhatsappParamsWhatsappMessageTemplateComponent{ { Type: telnyx.F("body"), Parameters: telnyx.F([]telnyx.MessageSendWhatsappParamsWhatsappMessageTemplateComponentParameter{ {Type: telnyx.F("text"), Text: telnyx.String("483291")}, }), }, }), }), }), }) if err != nil { log.Fatal(err) } fmt.Println(response.Data.ID)
Primary response fields:
response.Data.ID — Message UUIDresponse.Data.To[0].Status — queued, sent, delivered, failedresponse.Data.From.PhoneNumberresponse.Data.Type — WHATSAPPSend a text message within the 24-hour customer service window.
client.Messages.SendWhatsapp() — POST /messages/whatsapp
goctx := context.TODO() response, err := client.Messages.SendWhatsapp(ctx, telnyx.MessageSendWhatsappParams{ From: telnyx.String("+19452940762"), To: telnyx.String("+18005551234"), Type: telnyx.F(telnyx.MessageSendWhatsappParamsTypeWhatsapp), WhatsappMessage: telnyx.F(telnyx.MessageSendWhatsappParamsWhatsappMessage{ Type: telnyx.F("text"), Text: telnyx.F(map[string]interface{}{ "body": "Your order has shipped!", }), }), }) if err != nil { log.Fatal(err) } fmt.Println(response.Data.ID)
client.Whatsapp.BusinessAccounts.List() — GET /v2/whatsapp/business_accounts
goctx := context.TODO() response, err := client.Whatsapp.BusinessAccounts.List(ctx, telnyx.WhatsappBusinessAccountListParams{}) if err != nil { log.Fatal(err) } for _, waba := range response.Data { fmt.Printf("%s: %s (%s)\n", waba.ID, waba.Name, waba.Status) }
Primary response fields:
waba.ID — Telnyx WABA UUIDwaba.WabaID — Meta WABA IDwaba.Name — Business namewaba.Status — Account statuswaba.Country — WABA countryclient.Whatsapp.Templates.List() — GET /v2/whatsapp/message_templates
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | WabaID | string (UUID) | Yes | Telnyx WABA UUID | | Category | string | No | Filter: AUTHENTICATION, MARKETING, UTILITY | | Status | string | No | Filter: APPROVED, PENDING, REJECTED, DISABLED |
goctx := context.TODO() response, err := client.Whatsapp.Templates.List(ctx, telnyx.WhatsappTemplateListParams{ WabaID: telnyx.String("019c1ff0-5c30-7f36-8436-730b1d0b0e56"), Status: telnyx.String("APPROVED"), }, ) if err != nil { log.Fatal(err) } for _, tmpl := range response.Data { fmt.Printf("%s: %s (%s) - %s\n", tmpl.ID, tmpl.Name, tmpl.Category, tmpl.Status) }
Primary response fields:
tmpl.ID — Telnyx template UUID (use as template_id when sending)tmpl.Name — Template nametmpl.Category — AUTHENTICATION, MARKETING, or UTILITYtmpl.Language — Language codetmpl.Status — APPROVED, PENDING, REJECTED, DISABLEDtmpl.Components — Template componentsclient.Whatsapp.Templates.Create() — POST /v2/whatsapp/message_templates
goctx := context.TODO() response, err := client.Whatsapp.Templates.Create(ctx, telnyx.WhatsappTemplateCreateParams{ WabaID: telnyx.String("019c1ff0-5c30-7f36-8436-730b1d0b0e56"), Name: telnyx.String("order_shipped"), Category: telnyx.String("UTILITY"), Language: telnyx.String("en_US"), Components: telnyx.F([]telnyx.WhatsappTemplateCreateParamsComponent{ { Type: telnyx.F("BODY"), Text: telnyx.String("Your order {{1}} has been shipped and will arrive by {{2}}."), Example: telnyx.F(telnyx.WhatsappTemplateCreateParamsComponentExample{ BodyText: telnyx.F([][]string{{"ORD-12345", "March 20, 2026"}}), }), }, }), }, ) if err != nil { log.Fatal(err) } fmt.Printf("Template created: %s (status: %s)\n", response.Data.ID, response.Data.Status)
client.Whatsapp.PhoneNumbers.List() — GET /v2/whatsapp/phone_numbers
goctx := context.TODO() response, err := client.Whatsapp.PhoneNumbers.List(ctx, telnyx.WhatsappPhoneNumberListParams{ WabaID: telnyx.String("019c1ff0-5c30-7f36-8436-730b1d0b0e56"), }, ) if err != nil { log.Fatal(err) } for _, pn := range response.Data { fmt.Printf("%s - quality: %s\n", pn.PhoneNumber, pn.QualityRating) }
Telnyx signs webhooks with Ed25519. Always verify signatures in production:
goimport "github.com/team-telnyx/telnyx-go/webhook" event, err := webhook.ConstructEvent( payload, // []byte — raw request body request.Header.Get("telnyx-signature-ed25519"), request.Header.Get("telnyx-timestamp"), telnyxPublicKey, ) if err != nil { log.Printf("Webhook verification failed: %v", err) http.Error(w, "Invalid signature", http.StatusForbidden) return }
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) |
| 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 |
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 | SDK Method | Use Case | |-----------|-----------|----------| | Get template details | client.WhatsappMessageTemplates.Retrieve() | Check template status | | Get business profile | client.Whatsapp.PhoneNumbers.Profile.Retrieve() | View business profile | | Configure webhooks | client.Whatsapp.BusinessAccounts.Settings.Update() | Subscribe to events |
| Operation | SDK Method | Endpoint | Required Params | |-----------|-----------|----------|-----------------| | Send WhatsApp message | client.Messages.SendWhatsapp() | POST /messages/whatsapp | From, To, WhatsappMessage | | List WABAs | client.Whatsapp.BusinessAccounts.List() | GET /v2/whatsapp/business_accounts | — | | Get WABA | client.Whatsapp.BusinessAccounts.Retrieve() | GET /v2/whatsapp/business_accounts/:id | WabaID | | List templates | client.Whatsapp.Templates.List() | GET /v2/whatsapp/message_templates | WabaID | | Get template | client.WhatsappMessageTemplates.Retrieve() | GET /v2/whatsapp_message_templates/:id | TemplateID | | Create template | client.Whatsapp.Templates.Create() | POST /v2/whatsapp/message_templates | WabaID, Name, Category, Language, Components | | List phone numbers | client.Whatsapp.PhoneNumbers.List() | GET /v2/whatsapp/phone_numbers | WabaID | | Configure webhooks | client.Whatsapp.BusinessAccounts.Settings.Update() | PATCH /v2/whatsapp/business_accounts/:id/settings | WabaID |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→pass | 9,610 | 9,464 | -2% | 1 | 1 | 0% | 1,967 | 6,606 | +236% | 0 | 0 | — |
case-03 | fail→pass | 13,257 | 7,993 | -40% | 1 | 1 | 0% | 2,960 | 6,277 | +112% | 0 | 0 | — |
case-01 | fail→pass | 16,985 | 9,963 | -41% | 1 | 1 | 0% | 3,776 | 6,860 | +82% | 0 | 0 | — |
case-04 | fail→pass | 14,740 | 6,486 | -56% | 1 | 1 | 0% | 3,090 | 5,840 | +89% | 0 | 0 | — |
case-05 | fail→pass | 9,158 | 7,440 | -19% | 1 | 1 | 0% | 1,891 | 6,149 | +225% | 0 | 0 | — |
case-06 | fail→pass | 11,071 | 4,369 | -61% | 1 | 1 | 0% | 2,172 | 5,431 | +150% | 0 | 0 | — |
case-07 | fail→pass | 9,531 | 4,771 | -50% | 1 | 1 | 0% | 2,116 | 5,563 | +163% | 0 | 0 | — |
case-08 | fail→pass | 14,153 | 4,805 | -66% | 1 | 1 | 0% | 2,490 | 5,500 | +121% | 0 | 0 | — |
case-09 | fail→pass | 12,744 | 7,959 | -38% | 1 | 1 | 0% | 2,265 | 5,794 | +156% | 0 | 0 | — |
case-10 | pass→pass | 8,788 | 6,617 | -25% | 1 | 1 | 0% | 1,623 | 5,836 | +260% | 0 | 0 | — |
case-11 | pass→pass | 9,938 | 6,777 | -32% | 1 | 1 | 0% | 1,863 | 5,705 | +206% | 0 | 0 | — |
case-12 | pass→pass | 3,130 | 2,450 | -22% | 1 | 1 | 0% | 574 | 4,881 | +750% | 0 | 0 | — |
case-13 | fail→pass | 8,661 | 2,945 | -66% | 1 | 1 | 0% | 1,566 | 4,941 | +216% | 0 | 0 | — |
case-14 | pass→pass | 3,913 | 3,149 | -20% | 1 | 1 | 0% | 569 | 5,021 | +782% | 0 | 0 | — |
case-15 | fail→pass | 7,679 | 2,309 | -70% | 1 | 1 | 0% | 1,600 | 4,881 | +205% | 0 | 0 | — |
case-16 | pass→pass | 13,398 | 4,650 | -65% | 1 | 1 | 0% | 2,476 | 5,389 | +118% | 0 | 0 | — |
case-17 | pass→pass | 8,396 | 4,248 | -49% | 1 | 1 | 0% | 1,587 | 5,276 | +232% | 0 | 0 | — |
case-18 | fail→pass | 9,882 | 12,324 | +25% | 1 | 1 | 0% | 2,020 | 5,560 | +175% | 0 | 0 | — |
case-19 | fail→pass | 6,993 | 1,681 | -76% | 1 | 1 | 0% | 1,284 | 4,726 | +268% | 0 | 0 | — |
case-20 | pass→pass | 7,616 | 2,410 | -68% | 1 | 1 | 0% | 1,267 | 4,861 | +284% | 0 | 0 | — |
case-21 | pass→pass | 9,950 | 2,537 | -75% | 1 | 1 | 0% | 1,478 | 4,820 | +226% | 0 | 0 | — |
case-22 | fail→pass | 7,032 | 2,213 | -69% | 1 | 1 | 0% | 1,230 | 4,769 | +288% | 0 | 0 | — |
case-23 | pass→pass | 9,481 | 12,916 | +36% | 1 | 1 | 0% | 2,031 | 7,198 | +254% | 0 | 0 | — |
case-24 | pass→fail | 9,404 | 4,678 | -50% | 1 | 1 | 0% | 1,909 | 4,681 | +145% | 0 | 0 | — |
case-25 | pass→pass | 10,748 | 12,747 | +19% | 1 | 1 | 0% | 2,130 | 7,092 | +233% | 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. 25 cases were attempted, and 24 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 +52 percentage points is the difference between those two pass rates over the 24 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
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.