Summary
Every method under the whatsapp.* resource group builds a request URL with a doubled version prefix (/v2/v2/...), causing a 404 (10005 – Resource not found). The whatsapp.* path templates include a leading /v2, but the client's base_url already ends in /v2 — so they compound. Non-WhatsApp resources are correct and unaffected.
Version
telnyx 4.168.0 (Python)
- Default
base_url: https://api.telnyx.com/v2/
Reproduction
import telnyx
client = telnyx.Telnyx(api_key="...")
client.whatsapp.business_accounts.phone_numbers.initialize_verification(
"test_waba_id",
phone_number="test_phone_number",
display_name="Example",
verification_method="sms",
)
Actual request URL:
https://api.telnyx.com/v2/v2/whatsapp/business_accounts/test_waba_id/phone_numbers
→ 404 {'errors': [{'code': '10005', 'title': 'Resource not found', ...}]}
Expected:
https://api.telnyx.com/v2/whatsapp/business_accounts/test_waba_id/phone_numbers
Root cause
The whatsapp.* path templates start with /v2, unlike every other resource, which is relative to the already-versioned base_url:
| Method |
Path template in SDK |
phone_numbers.messaging.update |
/phone_numbers/{id}/messaging ✅ (no /v2) |
whatsapp.business_accounts.phone_numbers.initialize_verification |
/v2/whatsapp/business_accounts/{id}/phone_numbers ❌ |
whatsapp.business_accounts.phone_numbers.list |
/v2/whatsapp/business_accounts/{id}/phone_numbers ❌ |
whatsapp.phone_numbers.verify |
/v2/whatsapp/phone_numbers/{phone_number}/verify ❌ |
(Likely all whatsapp.* methods are affected; the three above are what I use.)
Suggested fix
Strip the leading /v2 from the whatsapp.* path templates so they're relative to base_url like every other resource. This looks like an
OpenAPI-spec/codegen inconsistency where the WhatsApp paths were specified with the version segment included.
Workaround
Construct a separate client with the host root as the base URL for WhatsApp calls:
wa = telnyx.Telnyx(api_key="...", base_url="https://api.telnyx.com")
wa.whatsapp.business_accounts.phone_numbers.initialize_verification(...) # → single /v2, works
(Can't be used for the whole client, since it would then break the correctly-pathed non-WhatsApp resources.)
Summary
Every method under the
whatsapp.*resource group builds a request URL with a doubled version prefix (/v2/v2/...), causing a404(10005 – Resource not found). Thewhatsapp.*path templates include a leading/v2, but the client'sbase_urlalready ends in/v2— so they compound. Non-WhatsApp resources are correct and unaffected.Version
telnyx4.168.0 (Python)base_url:https://api.telnyx.com/v2/Reproduction
Actual request URL:
→
404 {'errors': [{'code': '10005', 'title': 'Resource not found', ...}]}Expected:
Root cause
The
whatsapp.*path templates start with/v2, unlike every other resource, which is relative to the already-versionedbase_url:phone_numbers.messaging.update/phone_numbers/{id}/messaging✅ (no/v2)whatsapp.business_accounts.phone_numbers.initialize_verification/v2/whatsapp/business_accounts/{id}/phone_numbers❌whatsapp.business_accounts.phone_numbers.list/v2/whatsapp/business_accounts/{id}/phone_numbers❌whatsapp.phone_numbers.verify/v2/whatsapp/phone_numbers/{phone_number}/verify❌(Likely all
whatsapp.*methods are affected; the three above are what I use.)Suggested fix
Strip the leading
/v2from thewhatsapp.*path templates so they're relative tobase_urllike every other resource. This looks like anOpenAPI-spec/codegen inconsistency where the WhatsApp paths were specified with the version segment included.
Workaround
Construct a separate client with the host root as the base URL for WhatsApp calls:
(Can't be used for the whole client, since it would then break the correctly-pathed non-WhatsApp resources.)