Credentials ID when creating numbers question
# support
m
Hey, I am creating an automation to create assistants. I would like to bind numbers to the assistants as well. I see documentation for creating numbers, require a credentials id property. I have already created an integration via UI for vonage as the main call provider. How do I get the credentials id so I can use it to create the number?
m
This usually trips people up. The credentialsId isn’t exposed directly in the UI; it’s tied to the integration you created (Vonage), so you’ll need to fetch it via the integrations/credentials endpoint or inspect the network call when the integration was created. Once you have that ID, you can pass it when creating the number and bind it to your assistant. If you want, I can help you trace it quickly and set it up end to end. Are you creating the number via API already, or still testing from the dashboard? @Marios
c
Hi, I understand you're looking for information about the
credentialId
when creating a phone number in Vapi. While I can't see exactly where to find it in the dashboard interface, I can definitely explain what it is and how it's typically obtained. The
credentialId
is an identifier for authentication credentials used when creating a phone number in Vapi. According to the [documentation](https://docs.vapi.ai/api-reference/phone-numbers/create#response.body.telnyx.credentialId), it's used to configure the number for sending inbound calls to Vapi, making outbound calls, and performing live call updates like transfers and hangups. Here's what I found about how the
credentialId
relates to the API key: 1. The API key is used for authentication when creating credentials in Vapi. When you make API calls to create credentials, you include your API key in the
Authorization
header. 2. The
credentialId
is generated when you create a credential via the API. According to the information I found, when you create a credential using the
/credential
endpoint, the response includes an
id
field, which is the
credentialId
you need:
Copy code
{
  "id": "credential_id",
  "provider": "byo-sip-trunk",
  "name": "My SIP Trunk",
  ...
}
1. For Telnyx specifically, you would create a SIP Trunk Credential using a curl command like:
Copy code
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"
      }
    ]
  }'
The response from this API call will contain the
credentialId
that you'll need when creating a phone number. Ref: https://docs.vapi.ai/advanced/sip
m
thank you @Matt, I am creating everything via api. I can do a reqest to capture the creds id mentioned
it would be a good addition to add this id to UI somehow so this could be avoided
solved by doing exactly that
c
Thank you for the confirmation