I get error on custom byo SIP Trunking
# support
f
{ "message": "Couldn't validate SIP trunk credential. SIP gateway creation failed.", "error": "Bad Request", "statusCode": 400 } this is the error I got and this is the request I made curl --location 'https://api.vapi.ai/credential' \ --header 'Authorization: a7adc9f0-3246-4f2c-8576-5e2d3989d70b' \ --header 'Content-Type: application/json' \ --header 'Cookie: _cfuvid=INOrDcAbf9oqZfD61Arkh5d8f.7HPfokIU.dCvzZCu0-1754667836880-0.0.1.1-604800000' \ --data '{ "provider": "byo-sip-trunk", "name": "NETGSM - Randevoo", "gateways": [ { "ip": "sip.netgsm.com.tr", "port": 5060, "inboundEnabled": true, "outboundEnabled": true, "outboundProtocol": "udp" } ], "outboundLeadingPlusEnabled": true, "outboundAuthenticationPlan": { "authUsername": "2269110381", "authPassword": "mypassword", "sipRegisterPlan": { "domain": "sip.netgsm.com.tr", "username": "2269110381", "realm": "sip.netgsm.com.tr" } } }'
v
Try simplifying your request to only include the required fields, as extra fields may cause validation errors for custom SIP providers. Here’s a minimal example you can try:
Copy code
bash
curl -X POST 'https://api.vapi.ai/credential' \
  -H 'Authorization: Bearer YOUR_VAPI_PRIVATE_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "provider": "byo-sip-trunk",
    "name": "NETGSM - Randevoo",
    "gateways": [{ "ip": "sip.netgsm.com.tr" }],
    "outboundAuthenticationPlan": {
      "authUsername": "2269110381",
      "authPassword": "mypassword"
    }
  }'
If this still fails, double-check that your SIP server address and credentials are correct and supported by Vapi. [Reference: Vapi SIP Trunking Docs](https://docs.vapi.ai/advanced/sip/sip-trunk) Source: - [Vapi SIP Trunking Docs](https://docs.vapi.ai/advanced/sip/sip-trunk)
f
My credentials are correct Im sure
c
Use your SIP server’s IP address instead of its domain in the gateways field to fix the credential error..