Give Your AI Agent a Phone Number in 5 Minutes
Your AI agent can send email, but some workflows need a phone path too: urgent updates, appointment reminders, SMS replies, voice confirmation, and verification flows. This tutorial provisions a number, sends a real SMS, places a first voice call, and wires inbound events to a webhook.Prerequisites
- An Anima API key from console.useanima.sh
- Python 3.10+ or Node.js 18+
- An existing
agent_id - Phone access for SMS
- Voice access if you want to place the call step
- Consent to contact the destination number
1. Install the SDK
- Tab Title
- Tab Title
2. Search for available numbers
- Tab Title
- Tab Title
3. Provision the number
- Tab Title
- Tab Title
agent_id used for email, vault, DID, audit logs, and webhooks.
4. Text yourself
- Tab Title
- Tab Title
5. Call yourself
Outbound voice calls run through the voice gate before dialing. Only call recipients where you have the required consent.- Tab Title
- Tab Title
- Tab Title
- Tab Title
6. Handle inbound events
Inbound SMS arrives asmessage.received; inspect the message channel/payload to distinguish SMS from email. Call lifecycle events use the call.* namespace.
10DLC and voice compliance
For US SMS, 10DLC registration may be required depending on your use case and volume. Anima tracks phone identity status and carrier capability flags with the provisioned number. For US outbound voice calls, Anima enforces plan eligibility, TCPA consent posture, Reassigned Numbers Database checks, time-of-day windows, and per-tier call caps server-side. If a gate fails, the call is rejected before the provider dials.What makes this different
The phone number is not a disconnected CPaaS resource. It is part of the agent identity:- Same
agent_idacross email, SMS, voice, vault, and DID - Same policy and audit surface across channels
- Same webhook system for inbound and lifecycle events
- Same vault-backed credential boundary when the agent needs to act after the conversation
