# Voicemail Agent

- **URL:** https://agentline.cloud/build/voicemail-agent
- **Category:** Outbound
- **Keywords:** AI voicemail, AI leave voicemail, outbound AI calls voicemail, agentic calling, AI voice API

> Leave a message that actually gets returned

Outbound calls that are meant to miss. AgentLine detects the mailbox, leaves your voicemail_message, and you retry only the people who need a live conversation.

## How it works

1. Set voicemail_message on the agent — required, or it hangs up on mailboxes.
2. Place outbound calls as usual.
3. AgentLine navigates 'press 1 / press 2' mailbox menus with DTMF.
4. People who call back reach whatever inbound prompt you configured.

## Greeting

Hi, I was trying to reach you about your request.

## Voicemail

Hi, this is Sam from the team. I called about your request. Call me back on this number — that's the fastest way to finish this.

## System prompt

```
You are leaving a trail of voicemails and handling the few people who pick up. Keep turns under 12 words.

If a human answers:
- Identify yourself.
- Offer to talk now or call back.
- Do not read a long pitch.

If you reach a mailbox, stay quiet. AgentLine leaves voicemail_message. Do not try to speak over the beep.
```

## Python

```python
from agentline import AgentLine

client = AgentLine(api_key="al_live_...")

agent = client.agents.create(
    name="Voicemail Agent",
    voice_id="male-3",
    initial_greeting="Hi, I was trying to reach you about your request.",
    voicemail_message="Hi, this is Sam from the team. I called about your request. Call me back on this number.",
    system_prompt="""If a human answers, identify yourself in one sentence and offer a callback.
If you reach a mailbox, stay quiet — the configured voicemail is left for you.""",
)

client.numbers.buy(agent_id=agent.id, country="US", area_code="415")
call = client.calls.create(agent_id=agent.id, to="+14155557890")
print(call)
```

## Node.js

```ts
import AgentLine from "agentline";

const client = new AgentLine({ apiKey: "al_live_..." });

const agent = await client.agents.create({
  name: "Voicemail Agent",
  voiceId: "male-3",
  initialGreeting: "Hi, I was trying to reach you about your request.",
  voicemailMessage:
    "Hi, this is Sam from the team. I called about your request. Call me back on this number.",
  systemPrompt: `If a human answers, identify yourself and offer a callback.
If you reach a mailbox, stay quiet — the configured voicemail is left for you.`,
});

await client.numbers.buy({ agentId: agent.id, country: "US", areaCode: "415" });
const call = await client.calls.create({ agentId: agent.id, to: "+14155557890" });
console.log(call);
```

## Tell your AI

```
Set voicemail_message so my AgentLine agent can leave mailbox messages. Follow https://agentline.cloud/skill.md then apply https://agentline.cloud/build/voicemail-agent.md
```

## FAQ

**How do I make an AI agent leave a voicemail?**

PATCH the agent with voicemail_message. Without it, AgentLine detects the mailbox and hangs up. With it, the agent waits for the beep (or presses 2 to record) and leaves that message.

**Should I put 'stay silent on automated messages' in the prompt?**

No. That fights the built-in mailbox handler. Set voicemail_message and let AgentLine navigate the menu.

**What belongs in the message?**

Who you are, why you called, and the callback number. Keep it under 20 seconds.
