Build a personalized appointment campaign

Combine contact variables, voicemail handling, scheduling, and webhooks.

Use this guide after completing the Campaigns quickstart. It combines several campaign features in one appointment-reminder workflow.

This example pairs an assistant-controlled voicemail tool with contact variables in one campaign. The assistant reminds each recipient about a different appointment and leaves a personalized message when it confidently identifies voicemail.

Set up and launch the campaign

The flow below creates the voicemail tool, the assistant that uses it, and the campaign that calls your contacts. Follow it in the Dashboard or with cURL. For a deeper explanation, and for guidance on when to use the tool instead of built-in detection, see Campaign voicemail and call screening.

Both flows use the same three pieces of content, shown once here.

System prompt. This defines the live conversation and tells the model when to invoke the voicemail tool. The tool name referenced here must match the tool’s function.name.

System prompt
You make concise appointment-reminder calls. Listen before speaking.
## Live conversation
When a person answers with a natural greeting or response, greet {{name}} and
remind them about their appointment on {{appointment_date}} at {{location}}.
Ask whether they can attend. If they cannot attend, tell them that a team
member will follow up. Do not invent values when contact data is missing.
## Call classification
Do not begin the appointment reminder until you have classified what answered.
When uncertain, remain silent and continue listening.
Treat a natural "hello?", conversational response, or self-introduction as a
live person.
## Voicemail detection
Immediately invoke the `leave_voicemail_for_appointment` tool when you hear clear voicemail
language such as:
- "Please leave a message after the beep"
- "At the tone, please record your message"
- "You have reached the voicemail of"
- "The person you called is not available"
- "Your call has been forwarded to voicemail"
Do not invoke the voicemail tool for:
- "Please hold"
- "Press 1 for..."
- "Transferring your call"
- An automated call screener
- A natural human greeting
Invoke `leave_voicemail_for_appointment` at most once. Do not speak before or after invoking
the tool. The tool delivers the complete voicemail message and ends the call.

Voicemail script. This is the message the tool leaves. It supports the same per-contact variables as the prompt.

Voicemail message
Hi {{name}}, this is a reminder about your appointment on {{appointment_date}}
at {{location}}. Please contact us if you need to reschedule. Thank you.

Contacts. One row per recipient. The number column tells the campaign whom to call; the other columns become dynamic variables for that row, and their headers must match the variable names used in the prompt.

1number,name,appointment_date,location
2+14155550100,Ada,August 21 at 10:00 AM,Market Street
3+14155550101,Sam,August 22 at 2:30 PM,Mission Street

This sample uses reserved fictional phone numbers and placeholder appointment details. They pass format validation but do not reach a real person, so a campaign built from them will fail or place calls you did not intend. Before launching, even for a test, replace every number and its variable values with real contacts you have permission to call.

For more formatting rules and limits, see Campaign contact data.

1

Create the voicemail tool

In the Vapi Dashboard, go to Tools and select Create Tool. Choose Voicemail, name it leave_voicemail_for_appointment, and add a description. Select Use custom script and paste the voicemail script above, then save the tool.

2

Create the assistant

Go to Assistants and create an assistant. Set First Message Mode to Assistant waits for user, leave the first-message text empty, and paste the system prompt above.

3

Add the tool and publish

Open the assistant’s Tools section and add the leave_voicemail_for_appointment tool. Keep automatic voicemail detection disabled so the two approaches do not compete, then publish the assistant.

4

Configure the campaign caller

Go to Campaigns and select Create campaign. Enter a name, select an eligible outbound phone number, and choose the assistant you created.

Vapi Free Numbers cannot be used to launch campaigns. Import a number from a supported provider or configure a BYO SIP trunk number if you do not have an eligible number.

5

Set concurrency and upload contacts

Set Max concurrency to the maximum number of calls this campaign may have active at once. Start with a low value while testing; the campaign shares your organization’s total call concurrency with other calls.

On Contacts, upload appointment-reminders.csv. Confirm that each name and phone number appears in the preview. Additional columns are passed to the assistant even though they are not displayed in the preview.

6

Schedule, launch, and test

On Schedule, select Send now for a controlled test or Schedule for later to define a time zone and calling window. Creating the campaign launches it or schedules it; there is no saved draft, and a scheduled campaign cannot be edited before it runs.

Launch first with phone numbers controlled by your team. Confirm that a live answer receives the correct appointment values and that voicemail receives the configured message, then review each call record before increasing the audience or concurrency.

Keep automatic voicemail detection disabled while using the voicemail tool. This approach intentionally prefers silence over a weak voicemail classification. If a greeting is clipped or transcribed incorrectly, the assistant can remain silent until its configured silence timeout instead of leaving a message. Verify the transcript, tool invocation, ended reason, and recording in controlled test calls before scaling the campaign.

Extend the workflow

After the basic flow works, filter contacts before dialing by checking your system immediately before each call. For example, skip a contact whose appointment was canceled after the CSV was exported. You can also receive campaign events for campaign and contact lifecycle changes.

Best practices

  • Comply with calling regulations. Make sure you are following the consent, quiet-hours, and telemarketing rules that apply to each recipient before launching. See the TCPA consent guide and scheduling best practices.
  • Test conversations before calling contacts. Use Simulations to exercise the assistant or squad against realistic scenarios, including confirmations, rescheduling requests, missing variables, and unexpected responses. Use controlled test calls to verify phone-number, voicemail-detection, and call-screening behavior.
  • Publish tested assistant changes. Use assistant versioning to keep improvements in a draft while the current configuration continues handling calls. Publish after testing, add a meaningful version name and description, and retain a known-good version that you can restore if behavior regresses.
  • Start with a controlled audience. Launch the first campaign with phone numbers controlled by your team, verify contact variables and voicemail behavior in the call records, then increase the audience and concurrency.
  • Recheck scheduled campaigns. Because campaigns cannot be edited after creation, confirm the caller, phone number, contacts, schedule, concurrency, and webhook settings before launch.