Skip to main content

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
Use your own phone number for the first run.

1. Install the SDK

2. Search for available numbers

3. Provision the number

The number is linked to the agent’s unified identity: the same agent_id used for email, vault, DID, audit logs, and webhooks.

4. Text yourself

5. Call yourself

Outbound voice calls run through the voice gate before dialing. Only call recipients where you have the required consent.
After the call ends, fetch the transcript:

6. Handle inbound events

Inbound SMS arrives as message.received; inspect the message channel/payload to distinguish SMS from email. Call lifecycle events use the call.* namespace.
Example handler:

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_id across 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
Read the Phone docs | Set up webhooks | Get started