rival-black
rival-black2h ago

Error Getting All Details in Campaign and API request

When I'm making Campaign call, It's not using all details in csv. It supposed to use Name and all other info I've added in csv data for campaign. Instead it's only making call to phone number. Even when I'm trying to make API Call, still it's not using all data that we have.
5 Replies
Vapi Support Bot
To ensure all customer details from your CSV (like name, email, etc.) are used in campaign calls, structure your API request so each customer object includes all relevant fields. For example:
{
"name": "Q2 Sales Campaign",
"phoneNumberId": "your_phone_number_id",
"customers": [
{
"number": "+1234567890",
"name": "John Doe",
"email": "john@example.com"
// add other fields as needed
}
]
}
{
"name": "Q2 Sales Campaign",
"phoneNumberId": "your_phone_number_id",
"customers": [
{
"number": "+1234567890",
"name": "John Doe",
"email": "john@example.com"
// add other fields as needed
}
]
}
Make sure your CSV import maps each column to the corresponding property in the customers array before making the API call. See the API documentation for all available fields. Source: - Create Campaign API documentation
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
rival-black
rival-blackOP1h ago
@Vapi Support Bot { "assistantId": "a750022f-dfaa-4525-acef-4af9382f8449", "phoneNumberId": "f7d61175-3d61-4eac-aad9-9d5200754609", "customer": { "number": "+1{{contact.phone}}", "name": "{{contact.first_name}} {{contact.last_name}}" }, "assistantOverrides": { "variableValues": { "ghlContactId": "{{contact.id}}", "ghlFirstName": "{{contact.first_name}}", "ghlLastName": "{{contact.last_name}}", "ghlEmail": "{{contact.email}}", "campaign": "old-number-reactivation" } } }
Vapi Support Bot
Your API request should use a "customers" array (not "customer" singular) to include all customer details. Here’s the correct structure:
{
"assistantId": "a750022f-dfaa-4525-acef-4af9382f8449",
"phoneNumberId": "f7d61175-3d61-4eac-aad9-9d5200754609",
"customers": [
{
"number": "+1{{contact.phone}}",
"name": "{{contact.first_name}} {{contact.last_name}}",
"email": "{{contact.email}}"
// add other fields as needed
}
],
"assistantOverrides": {
"variableValues": {
"ghlContactId": "{{contact.id}}",
"ghlFirstName": "{{contact.first_name}}",
"ghlLastName": "{{contact.last_name}}",
"ghlEmail": "{{contact.email}}",
"campaign": "old-number-reactivation"
}
}
}
{
"assistantId": "a750022f-dfaa-4525-acef-4af9382f8449",
"phoneNumberId": "f7d61175-3d61-4eac-aad9-9d5200754609",
"customers": [
{
"number": "+1{{contact.phone}}",
"name": "{{contact.first_name}} {{contact.last_name}}",
"email": "{{contact.email}}"
// add other fields as needed
}
],
"assistantOverrides": {
"variableValues": {
"ghlContactId": "{{contact.id}}",
"ghlFirstName": "{{contact.first_name}}",
"ghlLastName": "{{contact.last_name}}",
"ghlEmail": "{{contact.email}}",
"campaign": "old-number-reactivation"
}
}
}
Update your request to use "customers" (plural) as shown above to ensure all details from your CSV are included.
See the API documentation for more details. Source: - Create Campaign API documentation
rival-black
rival-blackOP1h ago
@Vapi Support Bot But still it's not using all the details we sent. Like if we have the name John D. it should say Hi Jodn D. but it doesn't know what the name.
Vapi Support Bot
To ensure the assistant uses the customer's name (e.g., says "Hi John D."), make sure you both include the "name" field in each customer object and reference it in your assistant's prompt or script using a variable. For example, in your assistant's configuration, use a variable like {{name}}:
"customers": [
{
"number": "+1{{contact.phone}}",
"name": "{{contact.first_name}} {{contact.last_name}}"
}
],
"assistantOverrides": {
"variableValues": {
"name": "{{contact.first_name}} {{contact.last_name}}"
}
}
"customers": [
{
"number": "+1{{contact.phone}}",
"name": "{{contact.first_name}} {{contact.last_name}}"
}
],
"assistantOverrides": {
"variableValues": {
"name": "{{contact.first_name}} {{contact.last_name}}"
}
}
Then, in your assistant's greeting prompt, use:
Hi {{name}}, how can I help you? See the API documentation for more details. Source: - Create Campaign API documentation

Did you find this page helpful?