Skip to main content

Phone

Give your AI agents real phone numbers with SMS capabilities. Use phone numbers for two-factor authentication, appointment reminders, urgent notifications, or any outreach that requires text.

Search available numbers

Find numbers by country and area code before provisioning:
from anima import Anima

anima = Anima(api_key="ak_...")

numbers = anima.phone.search(
    country="US",
    area_code="415",
)
for n in numbers:
    print(f"{n.number} ({n.region})")

Provision a number

Assign an available number to an agent:
phone = anima.phone.provision(
    agent_id="ag_01abc123",
    number="+14155551234",
)
print(f"Provisioned: {phone.number}")

Send an SMS

message = anima.phone.send_sms(
    agent_id="ag_01abc123",
    to="+15551234567",
    body="Your appointment is confirmed for tomorrow at 2pm.",
)
print(f"SMS sent: {message.id}")

List numbers

List all phone numbers provisioned for an agent:
numbers = anima.phone.list(agent_id="ag_01abc123")
for n in numbers:
    print(f"{n.number}{n.status}")

Release a number

When a number is no longer needed, release it to stop billing:
anima.phone.release(
    agent_id="ag_01abc123",
    number="+14155551234",
)

Inbound SMS

To receive inbound SMS messages, configure a webhook endpoint in the dashboard. Anima posts an event to your endpoint whenever a message arrives at one of your agent’s numbers.
See Webhooks for how to register an endpoint and verify request signatures.