telnyx sip credentials

curl -X POST https://api.vapi.ai/credential \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
-d '{
"provider": "byo-sip-trunk",
"name": "Telnyx Trunk",
"gateways": [
{
"ip": "sip.telnyx.com"
}
],
"outboundAuthenticationPlan": {
"authUsername": "YOUR_SIP_USERNAME",
"authPassword": "YOUR_SIP_PASSWORD",
"sipRegisterPlan": {
"realm": "sip.telnyx.com"
}
}
}'

I am trying to connect my telnxy number to my vapi account. Inbound (FQDN) works fine, but whenever I try to set up outbound (via credentials) by using the curl request above, I receive an 400 error: {"message":"Couldn't validate SIP trunk credential. SIP gateway creation failed.","error":"Bad Request","statusCode":400}

Has anyone alse also faced this issue?
Was this page helpful?