Python SDK
The dial-sdk package is an async client for Python 3.11+.
Install
Construct a client
The client is async; call its methods with await inside an event loop.
Core operations
send_message and make_call choose the from-number with exactly one of
from_number (a flexible reference β phone number ID, one of your numbers in
E.164, or a nickname) or from_number_id (ID only).
Typing indicators
Show a typing indicator while composing. iMessage numbers display it; standard (SMS) numbers have no typing concept and silently ignore it, so the calls are safe unconditionally.
Delivering a message or reaction clears the indicator natively on the
recipientβs device. The session compensates: after each session.send_message
it automatically re-starts the indicator, so inside the block the bubble
persists β the only real stop is __aexit__ (which runs even when the block
raises). With the bare primitives, remember that a send clears it: call
start_typing again to keep composing, and stop_typing when you stop
without sending. There is no keep-alive, so a stale indicator may also clear
on its own during a very long pause.
The client makes a single attempt per call β it never auto-retries. MakeCallParams accepts an optional idempotency_key: pass the same key on each retry and a request that actually succeeded returns the original call instead of dialing again. send_message has no idempotency key β wrapping it in a retry can send a duplicate. See Retries and idempotency.
Stream events
new_events_connection() is an async context manager. Use async with so the connection closes cleanly.
If you canβt use async with, call await conn.close() yourself.
The stream is presence-based, not at-least-once β missed events replay only if you reconnect within 2 minutes. For durable, off-machine delivery, register a webhook β signed and retried at-least-once.
Types
Methods return typed PhoneNumber, Message, and Call dataclasses. See Core concepts for field meanings.