Error while creating phone number through Postman
# support
d
I'm running into an issue while trying to create a phone number using the byo-phone-number provider via the API. Here's the payload I'm sending: { "provider": "byo-phone-number", "name": "TEST_NAME", "number": "+91 (22) 0000 0000", "numberE164CheckEnabled": true, "credentialId": "TEST_SIP_CREDENTIAL" } The response I'm getting is: { "message": "Couldn't Create Phone Number.", "error": "Bad Request", "statusCode": 400 } This exact same setup was working about a week ago, but now it's consistently returning these 400 errors. Also, In headers we are sending authorization with bearer token where token is the pivate key is that correct Could someone help clarify!! Appreciate the help in resolving this! #1211483291191083018
v
To clarify: Are you using your Vapi private API key (not the SIP credential) as the bearer token in the
Authorization
header, like this?
Copy code
Authorization: Bearer YOUR_VAPI_PRIVATE_KEY
Using the wrong token or an invalid credentialId can cause a 400 Bad Request error. Please confirm if the correct API key is being used in your request header so I can assist further. Sources: - [Create Phone Number Vapi API Reference](https://docs.vapi.ai/api-reference/phone-numbers/create) - [SIP Trunk Integration Guide](https://docs.vapi.ai/advanced/sip/sip-trunk)
d
Yes, we are using the correct authorization header as you mentioned above!! #1211483291191083018 @Vapi Support Bot @Vapi @User @User
v
It looks like the phone number in your payload is not in strict E.164 format, which is required by the API. Try removing spaces and parentheses so it looks like this:
Copy code
json
{
  "provider": "byo-phone-number",
  "name": "TEST_NAME",
  "number": "+912200000000",
  "numberE164CheckEnabled": true,
  "credentialId": "TEST_SIP_CREDENTIAL"
}
If the issue persists, double-check that your
credentialId
is valid and active in your Vapi account. [See API reference for details](https://docs.vapi.ai/api-reference/phone-numbers/create) Source: - [Create Phone Number Vapi API Reference](https://docs.vapi.ai/api-reference/phone-numbers/create)
d
credential is proper still the issue is same !! @Vapi Support Bot #1211483291191083018 @Vapi @User @User
v
If your payload and credentialId are both correct and you are still receiving a 400 error, try regenerating your API key and ensure your account is in good standing. Sometimes, API keys can become invalid or permissions may change unexpectedly. If the issue persists, please contact Vapi support with your request details and error response for further investigation. Example payload (E.164 format):
Copy code
json
{
  "provider": "byo-phone-number",
  "name": "TEST_NAME",
  "number": "+912200000000",
  "numberE164CheckEnabled": true,
  "credentialId": "TEST_SIP_CREDENTIAL"
}
[API Reference](https://docs.vapi.ai/api-reference/phone-numbers/create) Source: - [Create Phone Number Vapi API Reference](https://docs.vapi.ai/api-reference/phone-numbers/create)
d
we have tried all the possible outcome you suggested still the same issue @Vapi Support Bot #1211483291191083018
v
Thank you for confirming you've tried all suggested steps. Could you please share if there have been any recent changes to your Vapi account, permissions, or the phone number provider (such as region restrictions or number validity)? This will help narrow down the cause of the persistent 400 error. Source: - [Create Phone Number Vapi API Reference](https://docs.vapi.ai/api-reference/phone-numbers/create)
d
nope everthing is same just we have made some upgrades to our account and we have created more thn 30 numbers with this #1211483291191083018 @Vapi Support Bot
v
Since you've confirmed your payload, credentialId, and API key are all correct and the issue persists, the best next step is to contact Vapi support directly with your request details and error response. Include your full API request, response, and any relevant account information so they can investigate backend issues or account-specific restrictions. Example support message:
Copy code
Subject: Persistent 400 Error on /phone-number API
Details: [Include your payload, error response, and recent account changes]
This will help the support team resolve your issue efficiently. Source: - [Create Phone Number Vapi API Reference](https://docs.vapi.ai/api-reference/phone-numbers/create)
d
where can get contact of vapi support #1211483291191083018 @Vapi Support Bot
v
You can contact Vapi support directly by emailing support@vapi.ai with your request details and error response. For fastest assistance, include your full API request, error message, and any recent account changes in your message.
Copy code
text
To: support@vapi.ai
Subject: Persistent 400 Error on /phone-number API
Details: [Include your payload, error response, and recent account changes]
For more support options, see the [Vapi Support page](https://docs.vapi.ai/support). Source: - [Vapi Support Documentation](https://docs.vapi.ai/support)
c
You need to include the credentialId that was created when you made the BYO SIP trunk. Please provide your org id and we will send you your credentialId from the database for your BYO SIP trunk. If you created the BYO SIP trunk through the API, it should have sent you the credentialId in the response to your request payload.
3 Views