Error Getting All Details in Campaign and API requ...
# support
c
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.
v
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:
Copy code
json
{
  "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](https://docs.vapi.ai/api-reference/campaigns/campaign-controller-create?explorer=true) for all available fields. Source: - [Create Campaign API documentation](https://docs.vapi.ai/api-reference/campaigns/campaign-controller-create?explorer=true)
c
@Vapi Support Bot
Copy code
{
  "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"
    }
  }
}
v
Your API request should use a "customers" array (not "customer" singular) to include all customer details. Here’s the correct structure:
Copy code
json
{
  "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](https://docs.vapi.ai/api-reference/campaigns/campaign-controller-create?explorer=true) for more details. Source: - [Create Campaign API documentation](https://docs.vapi.ai/api-reference/campaigns/campaign-controller-create?explorer=true)
c
@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.
v
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}}`:
Copy code
json
"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](https://docs.vapi.ai/api-reference/campaigns/campaign-controller-create?explorer=true) for more details. Source: - [Create Campaign API documentation](https://docs.vapi.ai/api-reference/campaigns/campaign-controller-create?explorer=true)
c
Hi CG๛ALPHAッ, To ensure all customer details in your CSV are used during campaign calls, make sure your API request includes a correctly structured
"customers"
array. Each customer object should contain all relevant fields like this:
Copy code
json
{
  "assistantId": "a750022f-dfaa-4525-acef-4af9382f8449",
  "phoneNumberId": "f7d61175-3d61-4eac-aad9-9d5200754609",
  "customers": [
    {
      "number": "+1234567890",
      "name": "John Doe",
      "email": "john@example.com"
      // add other fields as needed
    }
  ],
  "assistantOverrides": {
    "variableValues": {
      "name": "John Doe",
      "email": "john@example.com",
      "campaign": "old-number-reactivation"
    }
  }
}
Ensure that in your assistant's prompt, you are using the variables like
{{name}}
. Double-check that your CSV import maps each column to the correct property in the
customers
array. For further details, refer to the [Create Campaign API documentation](https://docs.vapi.ai/api-reference/campaigns/campaign-controller-create?explorer=true).
2 Views