How to set Incoming numbers to call back while mak...
# support
d
I have a number bought from Twilio and wants to use that number as called number for all my outgoing voice outbound call. How I can achieve this please through vapi platform? Thanks
v
message has been deleted
@dl_amit That's great to hear that you want to use your Twilio number with VAPI for your outgoing calls! To use your own phone number from Twilio as the caller ID for all your outgoing voice calls through the VAPI platform, you'll need to import your number into VAPI using the dashboard or the
/phone-numbers/import
endpoint. Here's how you can do it: 1. Log in to your VAPI dashboard. 2. Navigate to the phone numbers section. 3. Use the import feature to add your Twilio number. - You will need to provide your Twilio credentials for verification. - Follow the prompts to configure your number with VAPI services. Alternatively, you can use the
/phone-numbers/import
endpoint by sending a POST request with your Twilio credentials and the phone number you wish to import. Once your number is imported and configured, you can set it as the caller ID for your outbound calls in your VAPI application settings or specify it in the API call when making an outbound call. If you need any assistance with the API call or have any other questions, please let me know!
You can continue this conversation by mentioning me in the message.
d
Can i set set this number separate for each agent @Vapi
v
@dl_amit Yes, you can set a specific caller ID for each agent in your VAPI application. When you create a call for an agent, you can specify the caller ID that you want to use for that particular call. This means you can have different Twilio numbers for each agent, and you can set them individually when initiating the call. Here's a simplified example of how you might set this up in your call creation logic:
Copy code
javascript
// Define your agents and their respective caller IDs
const agents = {
  agent1: { callerId: 'agent1_twilio_number' },
  agent2: { callerId: 'agent2_twilio_number' },
  // ... other agents
};

// When making a call for an agent, use their specific caller ID
function makeCall(agentId, destinationNumber) {
  const agent = agents[agentId];
  if (agent) {
    // Use VAPI to start the call with the agent's caller ID
    // Replace 'startCall' with the actual VAPI function to make an outbound call
    startCall({
      from: agent.callerId,
      to: destinationNumber,
      // ... other call parameters
    });
  } else {
    console.error('Agent not found');
  }
}

// Example usage
makeCall('agent1', '+1234567890'); // This will use agent1's Twilio number as the caller ID
Remember to replace
'startCall'
with the actual function or API endpoint provided by VAPI for making an outbound call, and include any other necessary parameters as per your application's requirements. If you need further assistance with the API call or have any other questions, feel free to ask!
d
@Vapi let me know the API name and exact payload for achieving this purpose
v
@dl_amit To achieve this purpose, you would typically use the API endpoint for creating outbound calls. However, VAPI does not have a specific API endpoint documented in the context provided. In a general scenario, an API for making outbound calls might look like this: API Endpoint:
Copy code
POST /calls/outbound
Payload:
Copy code
json
{
  "from": "Your_Twilio_Number",
  "to": "Destination_Number",
  "applicationId": "Your_Application_Id",
  "answerUrl": "URL_to_Handle_Call_Logic"
}
In this payload: - `"from"`: This is the caller ID you want to display, which would be your Twilio number. - `"to"`: This is the destination phone number you want to call. - `"applicationId"`: This is the ID of your VAPI application that contains the call logic. - `"answerUrl"`: This is the URL that VAPI will request to retrieve instructions for handling the call. Since VAPI's actual API and payload structure are not provided in the context, please refer to VAPI's official documentation or contact support for the exact API endpoint and payload structure you should use. If you have access to the documentation or if there's a specific function you're supposed to call, please provide that information, and I can help you construct the exact payload. Otherwise, for the exact details on how to integrate with Twilio and set the caller ID for each agent, you would need to consult VAPI's documentation or ask support for more info on this.
d
In this same payload, I want to update the prompt, attach new payload and set the from twilio number and then start the voice agent for making outbound clal @Vapi
v
@dl_amit To update the payload with a prompt, attach additional information, set the 'from' number to your Twilio number, and start the voice agent for making an outbound call, you would typically include these details in the payload you send to the API endpoint for creating outbound calls. Here's an example of what the updated payload might look like:
Copy code
json
{
  "from": "Your_Twilio_Number",
  "to": "Destination_Number",
  "applicationId": "Your_Application_Id",
  "answerUrl": "URL_to_Handle_Call_Logic",
  "prompt": "Your custom prompt message",
  "voiceAgent": {
    "start": true,
    "additionalPayload": {
      // Include any additional data you want to send to the voice agent
    }
  }
}
In this updated payload: - `"prompt"`: This is the custom message or instruction you want to play to the recipient of the call. - `"voiceAgent"`: This object contains the parameters to control the voice agent, including a command to start the agent and any additional payload you want to attach. Please note that the actual structure of the payload and the parameters you need to include may vary depending on VAPI's specific API requirements. The example above is a general representation and may not match VAPI's actual API specification. Since the exact API name and payload structure are not provided in the context, you would need to refer to the VAPI documentation for the correct API endpoint and payload format. If you have access to the documentation or if there's a specific function you're supposed to call, please provide that information, and I can help you construct the exact payload. If you're unsure about the details, please ask support for more info on this.
d
@Vapi My requirements are create a new knowledge article, create new agent with that knowledge article, new prompts and all setup for agent and also set from Twilio number so that voice agent takes that number as caller Id. Now tell me exact Vapi api names and in which order i need to call them
v
@dl_amit Based on your requirements, you'll need to perform several steps to set up your voice agent with VAPI. However, without specific API documentation or endpoint details provided in the context, I can only give you a general outline of the steps you would typically follow. Here's a high-level sequence of actions you might take: 1. **Create a Knowledge Article**: Use an API endpoint that allows you to create or upload knowledge content that your voice agent will use to answer questions or provide information. 2. **Create a New Agent**: Use an API endpoint to create a new voice agent and associate it with the knowledge article you created in the previous step. 3. **Set Up Prompts**: Use an API endpoint to configure prompts or messages that your agent will use during calls. 4. **Configure Agent Settings**: Use an API endpoint to set up any additional settings for your agent, such as language, voice, and operational hours. 5. **Import Twilio Number**: Use an API endpoint to import your Twilio number into VAPI and set it as the 'from' number for your agent's outbound calls. 6. **Create Outbound Call**: Finally, use an API endpoint to initiate an outbound call with your voice agent, using the Twilio number as the caller ID. The exact API names and endpoints for these actions would be specific to VAPI's platform. Since the context does not include the actual API names or documentation, I recommend checking VAPI's official API documentation or contacting their support team for detailed instructions on how to use their API to accomplish these tasks. If you have access to the VAPI documentation or if there are specific functions or endpoints you know you need to use, please provide that information, and I can assist you further. Otherwise, for the exact API names and the order in which to call them, please ask support for more info on this.
d
I may have to make 200 daily voice outbound call for different contact and so i need different persona and different knowledge article. @Vapi is this better to have different agent for each of this persona and hence their outbound call? Do you see architectural issue here
respond @Vapi
pl respond @Vapi
I may have to make 200 daily voice outbound call for different contact and so i need different persona and different knowledge article. @Vapi is this better to have different agent for each of this persona and hence their outbound call? Do you see architectural issue here
any update on this @Vapi ?
s
@dl_amit can you please rephrase it and share an example as well if possible.
d
@Shubham Bajaj @User We will have daily 100's of contacts to reach for B2B sales and each of these contact will have separate knowledge articles linked. There will be follow up call also associated if the receiver wants. So i am thinking of having assistant and contact to outreach as 1:1 relation and do you see any issue into VAPI platform maintenance for such huge number of assistant?
s
No we don't have any issues, you can do it without any hassle.
d
Is there any notification that we get once the outbound call is over from our API call? Is this sync call from our API or the API call is async and then vapi platform handles outbound call?
s
@dl_amit you can use status-update event to know about when calls has finished and it's complete async https://docs.vapi.ai/server-url/events#call-status-updates
15 Views