Telnyx native phone number
# support
r
Hi, I tried to add telnyx phone number few times, but everytime I receive an error for wrong api key. Also I would like to ask if there is possiblity of adding it trough API, not dashboard. I tried ApiKey v1, v2 and some special Voice API key. None of these worked. https://cdn.discordapp.com/attachments/1352671566122713158/1352671566432960635/image.png?ex=67dedd10&is=67dd8b90&hm=2ca9c1e38f785b7cdcfd6e8b8c03e21f5df6f142ac507d376d40a09864c36d75& https://cdn.discordapp.com/attachments/1352671566122713158/1352671566739148861/image.png?ex=67dedd10&is=67dd8b90&hm=12f0354dc840eb1de4ff941484696032e9bc8bfe15759d37754f26a7017a720c&
I know I may set it up with SIP, but TBH, I would preffer this instead of SIP, SIP is just pain...
@User
s
I'm facing the same problem. I tried everything, nothing changes. Please fix this @Vapi Support Bot @Vapi
v
Hi there! 👋 I understand you're having trouble adding a Telnyx phone number due to API key errors, and you'd prefer to use the API rather than SIP. Let me help with what I can! Unfortunately, I can't determine exactly why your specific API keys (v1, v2, and Voice API key) aren't working with Telnyx. However, I can provide some troubleshooting steps and information on how to add a Telnyx number via the API. ## API Key Troubleshooting When encountering "invalid credentials" errors, here are some general steps to try: 1. **Verify the API Key**: Double-check that you're using the correct Vapi private API key [according to troubleshooting information](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1328923059905630238). 2. **Check Key Type**: Make sure you're using the private API key (not the public key) for operations like adding phone numbers [according to API key documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1328923059905630238). 3. **Confirm Key Format**: Ensure there are no extra spaces or characters in your API key. ## Adding Telnyx Number via API Here's how to add a Telnyx phone number using the Vapi API:
Copy code
bash
curl -X POST https://api.vapi.ai/credential \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer your-vapi-private-api-key" \
    -d '{
        "provider": "byo-sip-trunk",
        "name": "Telnyx Trunk",
        "gateways": [
            {
                "ip": "sip.telnyx.com"
            }
        ]
    }'
After creating the credential, you can create a phone number associated with it: ```bash curl -X POST https://api.vapi.ai/phone-number \ -H "Content-Type: application/json" \ -H "Authorization: Bearer your-vapi-private-api-key" \ -d '{ "provider": "byo-phone-number", "name": "Telnyx SIP Number", "number": "your-sip-phone-number", "numberE164CheckEnabled": false,
"credentialId": "your-new-trunk-credential-id-which-you-got-from-previous-step" }' ``` These examples are from the [Telnyx integration documentation](https://docs.vapi.ai/advanced/sip/telnyx). Is there anything specific about these API calls you'd like me to explain further? Sources: - [Troubleshooting invalid API key error when adding Telnyx phone number to Vapi](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1328923059905630238) - [Different types of Vapi API keys and their uses](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1328923059905630238) - [How to add Telnyx phone number via Vapi API](https://docs.vapi.ai/advanced/sip/telnyx)
k
Hey Radim, Thanks for pointing this out. Let me check with the team.What's going wrong here!! Until then, as we have already mentioned, you can use SIP (if it's required urgently).
s
Thank you @Shubham Bajaj @Vapi Support Bot for helping. When we have to connect numbers almost everyday, the time saving and comfort side of the simple API importing would worth us gold.
v
Hi there! 👋 You're very welcome! I completely understand how valuable time-saving features like simple API importing can be, especially when you're connecting numbers on a daily basis. I've made sure to pass along your feedback about the importance of streamlining this process. We appreciate you highlighting how this would benefit your workflow! Is there anything else I can help you with regarding your Vapi implementation?
r
Thank you, I am good, not urgent, just want to start using Telnyx sooner or later. Let me know when it works via native integration, thank you.
k
FYI I just replied to Radim over DM which API key is correct to use, and his issue has been resolved
v
Message marked as helpful by @stevechef_! 🎉
s
Could you DM me too pleasE?
s
@stevechef_ I helped him by picking one API key at a time and validating it. If you need help like this, send me the API keys that need verification. @Radim Kopp Can you also help me navigate to exactly where to look for the right API key?
r
It was to first API key on the Dashboard
Stars with KEY
As I said, I tried that one few times and didn’t work For me, you’re just a magician⚡️😂