dial_sdk.types

Attributes

Classes

Billing

BillingActivityItem

One activity-ledger item from GET /api/v1/billing/activity. type selects

BillingActivityPage

One page of activity, newest-first. has_more signals further pages.

BillingDeposit

BillingNumber

BillingPaymentMethod

BillingPricing

BillingSubscription

Call

CallEnded

dict() -> new empty dictionary

CallEndedData

dict() -> new empty dictionary

CallStatus

Server-derived, client-facing call status (camelCase, as returned).

CallStatusChanged

dict() -> new empty dictionary

CallStatusChangedData

dict() -> new empty dictionary

CallStatusChangedStatus

The status the call just entered — mirrors the call record's derived status.

CallTranscribed

dict() -> new empty dictionary

CallTranscribedData

dict() -> new empty dictionary

CapabilityState

One capability's state.

Contact

One phone number the account's lines have talked to.

ContactsPage

One page of contacts, and whether older ones remain.

DialConfig

Group

A group conversation — a conversation that isn't a phone number.

MakeCallParams

MediaItem

Raw bytes to upload as a media attachment; the MIME type is required.

Message

MessageMediaItem

A media attachment on a message, hosted by Dial.

MessageReceived

dict() -> new empty dictionary

MessageReceivedData

dict() -> new empty dictionary

MessageReceivedMediaItem

dict() -> new empty dictionary

MessageStatusChanged

dict() -> new empty dictionary

MessageStatusChangedData

An advance on one of an outbound message's two independent axes.

NumberLookup

What a phone number can receive.

NumberStatusChanged

dict() -> new empty dictionary

NumberStatusChangedData

A change to one of a phone number's capabilities.

PhoneNumber

PurchaseNumberParams

RelatedObject

dict() -> new empty dictionary

SendMessageParams

TranscriptTurn

One uninterrupted stretch of speech by one party, placed in time.

Module Contents

class dial_sdk.types.Billing
classmethod from_api(d: dict) → Billing
balance_cents: int
deposits: list[BillingDeposit]
numbers: list[BillingNumber]
numbers_release_at: str | None
payment_methods: list[BillingPaymentMethod]
pricing: BillingPricing
subscription: BillingSubscription | None
class dial_sdk.types.BillingActivityItem

One activity-ledger item from GET /api/v1/billing/activity. type selects which fields are populated: - ‘usage’ → fare_name, number, billed_quantity, total_cents, attribution, phone_number_id, call_id, message_id - ‘credit’ → amount_cents, kind, invoice_id - ‘payment’ → amount_cents, invoice_id, reason

classmethod from_api(d: dict) → BillingActivityItem
amount_cents: int | None = None
attribution: str | None = None
billed_quantity: int | None = None
call_id: str | None = None
fare_name: str | None = None
invoice_id: str | None = None
kind: str | None = None
message_id: str | None = None
number: str | None = None
occurred_at: str
phone_number_id: str | None = None
reason: str | None = None
total_cents: int | None = None
type: str
class dial_sdk.types.BillingActivityPage

One page of activity, newest-first. has_more signals further pages.

classmethod from_api(d: dict) → BillingActivityPage
data: list[BillingActivityItem]
has_more: bool
class dial_sdk.types.BillingDeposit
classmethod from_api(d: dict) → BillingDeposit
amount_cents: int
created_at: str
invoice_id: str | None = None
kind: str
class dial_sdk.types.BillingNumber
classmethod from_api(d: dict) → BillingNumber
id: str
mode: str
nickname: str | None = None
number: str
class dial_sdk.types.BillingPaymentMethod
classmethod from_api(d: dict) → BillingPaymentMethod
brand: str
email: str | None
exp_month: int
exp_year: int
id: str
is_default: bool
last4: str
type: str
class dial_sdk.types.BillingPricing
classmethod from_api(d: dict) → BillingPricing
annual_cents: int
monthly_cents: int
class dial_sdk.types.BillingSubscription
classmethod from_api(d: dict) → BillingSubscription
cancel_at_period_end: bool
interval: str
period_end: str
period_start: str
quantity: int
class dial_sdk.types.Call
classmethod from_api(d: dict) → Call
call_started_at: str | None
cancel_requested_at: str | None
created_at: str
direction: str
duration: int
from_: str
id: str
instruction: str | None
phone_number_id: str
queued_at: str | None
started_ringing_at: str | None
status: CallStatus
terminated_at: str | None
termination_type: str | None
to: str
transcript: str | None
transcript_turns: list[TranscriptTurn] | None
transfer_to: str | None
transferred_at: str | None
class dial_sdk.types.CallEnded

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

createdAt: str
data: CallEndedData
id: str
object: Literal['event']
relatedObject: RelatedObject | None
type: Literal['call.ended']
version: int
class dial_sdk.types.CallEndedData

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

callId: str
canceled: bool
direction: str
durationSeconds: int | None
from_: str
status: str
to: str
transcriptAvailable: bool
class dial_sdk.types.CallStatus

Bases: TypedDict

Server-derived, client-facing call status (camelCase, as returned).

Initialize self. See help(type(self)) for accurate signature.

cancelPending: bool
cancelRequested: bool
label: str
state: str
terminationType: str | None
class dial_sdk.types.CallStatusChanged

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

createdAt: str
data: CallStatusChangedData
id: str
object: Literal['event']
relatedObject: RelatedObject | None
type: Literal['call.status_changed']
version: int
class dial_sdk.types.CallStatusChangedData

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

callId: str
direction: str
from_: str
phoneNumberId: str
previousState: str | None
status: CallStatusChangedStatus
terminationType: str | None
to: str
class dial_sdk.types.CallStatusChangedStatus

Bases: TypedDict

The status the call just entered — mirrors the call record’s derived status.

Initialize self. See help(type(self)) for accurate signature.

label: str
state: str
class dial_sdk.types.CallTranscribed

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

createdAt: str
data: CallTranscribedData
id: str
object: Literal['event']
relatedObject: RelatedObject | None
type: Literal['call.transcribed']
version: int
class dial_sdk.types.CallTranscribedData

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

callId: str
class dial_sdk.types.CapabilityState

Bases: TypedDict

One capability’s state.

previousStatus, error and retryAvailableAt appear only on the asynchronous capabilities (call on an iMessage number, and whatsapp); a synchronous one has no transition to report and cannot fail.

Initialize self. See help(type(self)) for accurate signature.

error: str | None
previousStatus: str | None
retryAvailableAt: str | None
status: str
class dial_sdk.types.Contact

One phone number the account’s lines have talked to.

Derived from message and call history rather than stored: there is no address book to add anyone to, so a contact has no id — the number is its identity.

classmethod from_api(d: dict) → Contact
call_count: int
last_at: str
last_body: str
last_call_duration: int | None
last_direction: str
last_kind: str
last_media_count: int
last_redacted: bool
message_count: int
number: str
class dial_sdk.types.ContactsPage

One page of contacts, and whether older ones remain.

classmethod from_api(d: dict) → ContactsPage
contacts: list[Contact]
has_more: bool
class dial_sdk.types.DialConfig
api_key: str
base_url: str | None = None
user_agent: str | None = None
class dial_sdk.types.Group

A group conversation — a conversation that isn’t a phone number.

Pass id as group_id when sending or listing messages.

classmethod from_api(d: dict) → Group
channel: Literal['whatsapp', 'imessage']
created_at: str
id: str
name: str | None
class dial_sdk.types.MakeCallParams
from_number: str | None = None
from_number_id: str | None = None
idempotency_key: str | None = None
language: str | None = None
max_call_duration_seconds: int | None = None
outbound_instruction: str = ''
to: str
transfer_to: str | None = None
voice_gender: str | None = None
class dial_sdk.types.MediaItem

Raw bytes to upload as a media attachment; the MIME type is required.

content_type: str
data: bytes
filename: str = 'media'
class dial_sdk.types.Message
classmethod from_api(d: dict) → Message
body: str
channel: str
created_at: str
delivery_error: str | None = None
delivery_state: str | None = None
direction: str
from_: str
group_id: str | None = None
id: str
media: list[MessageMediaItem] = []
phone_number_id: str
reaction: str | None = None
read_at: str | None = None
read_state: str | None = None
reply_to_id: str | None = None
status: str
status_error: str | None = None
to: str | None
class dial_sdk.types.MessageMediaItem

A media attachment on a message, hosted by Dial.

classmethod from_api(d: dict) → MessageMediaItem
content_type: str
id: str
original_url: str | None
url: str
class dial_sdk.types.MessageReceived

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

createdAt: str
data: MessageReceivedData
id: str
object: Literal['event']
relatedObject: RelatedObject | None
type: Literal['message.received']
version: int
class dial_sdk.types.MessageReceivedData

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

body: str
channel: str
from_: str
media: list[MessageReceivedMediaItem]
messageId: str
source: str
to: str
class dial_sdk.types.MessageReceivedMediaItem

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

contentType: str
id: str
originalUrl: str | None
url: str
class dial_sdk.types.MessageStatusChanged

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

createdAt: str
data: MessageStatusChangedData
id: str
object: Literal['event']
relatedObject: RelatedObject | None
type: Literal['message.status_changed']
version: int
class dial_sdk.types.MessageStatusChangedData

Bases: TypedDict

An advance on one of an outbound message’s two independent axes.

Delivery and reads are separate facts — not every rail reports both — so the payload carries the current value of BOTH axes plus changed naming the one that just moved. Each event is therefore a complete snapshot.

Initialize self. See help(type(self)) for accurate signature.

changed: str
channel: str
deliveryError: str | None
deliveryState: str
from_: str
messageId: str
phoneNumberId: str
readState: str
to: str
class dial_sdk.types.NumberLookup

What a phone number can receive.

supports describes the number that was asked about, NOT one of your own lines. It is a point-in-time answer rather than a property of the number: someone who changes device or turns a service off stops being reachable, so treat a True as a strong signal for picking a channel, not a promise that a later send is delivered.

classmethod from_api(d: dict) → NumberLookup
number: str
supports: dict[str, bool]
class dial_sdk.types.NumberStatusChanged

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

createdAt: str
data: NumberStatusChangedData
id: str
object: Literal['event']
relatedObject: RelatedObject | None
type: Literal['number.status_changed']
version: int
class dial_sdk.types.NumberStatusChangedData

Bases: TypedDict

A change to one of a phone number’s capabilities.

Wait on this instead of polling a number until it is usable.

status folds the capabilities: unsettled while any is still working, ready when all are ready, degraded when everything has finished trying and something failed. ready and degraded are both terminal, so waiting on either always resolves — degraded exists because WhatsApp can be declined outright while the number still works for calls and messages.

Payload version 2. Version 1 was flat (setupStatus/setupError and a capabilities string list) and had nowhere to put a WhatsApp failure or its cooldown.

Initialize self. See help(type(self)) for accurate signature.

capabilities: dict[str, CapabilityState]
changed: list[str]
number: str
phoneNumberId: str
previousStatus: str | None
status: str
class dial_sdk.types.PhoneNumber
classmethod from_api(d: dict) → PhoneNumber
account_id: str
avatar_url: str | None = None
calling_enabled: bool
capabilities: list[str]
country: str
created_at: str
first_name: str | None = None
forward_to: str | None = None
id: str
inbound_instruction: str | None
inbound_language: str | None
inbound_voice_gender: str | None
last_name: str | None = None
max_call_duration_seconds: int | None
nickname: str | None
number: str
setup_error: str | None
setup_status: str
whatsapp: dict | None = None
whatsapp_avatar_url: str | None = None
whatsapp_name: str | None = None
class dial_sdk.types.PurchaseNumberParams
area_code: str | None = None
calling_enabled: bool | None = None
inbound_instruction: str
inbound_language: str | None = None
inbound_voice_gender: str | None = None
include_imessage: bool = False
class dial_sdk.types.RelatedObject

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

id: str
type: Literal['call', 'message']
url: str | None
class dial_sdk.types.SendMessageParams
body: str = ''
channel: str | None = None
force_audio_file: bool = False
from_number: str | None = None
from_number_id: str | None = None
group_id: str | None = None
media: list[SendMessageMedia] = []
to: str = ''
class dial_sdk.types.TranscriptTurn

One uninterrupted stretch of speech by one party, placed in time.

Offsets count milliseconds from the start of the call’s audio, so the pause before a turn is its start_ms minus the previous turn’s end_ms.

The offsets are approximate: they come from per-word timings the voice runtime does not guarantee to be exact. Ample for spotting a long silence, which is what they are for; not a basis for splitting tenths of a second.

classmethod from_api(d: dict) → TranscriptTurn
end_ms: int
speaker: str
start_ms: int
text: str
dial_sdk.types.CallEvent
dial_sdk.types.DialEvent
dial_sdk.types.MessageEvent
dial_sdk.types.SendMessageMedia