Metadata-Version: 2.4
Name: rizzdial
Version: 0.1.0
Summary: Official Python SDK for the RizzDial API
Project-URL: Homepage, https://github.com/rizlerai/rizzdial-sdk
Project-URL: Repository, https://github.com/rizlerai/rizzdial-sdk
Author: RizzDial
License: MIT
Keywords: ai,api,dialer,rizzdial,sdk,voice
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Requires-Dist: httpx>=0.24
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Description-Content-Type: text/markdown

# rizzdial

Official Python SDK for the [RizzDial](https://rizzdial.com) API.

- Single dependency: `httpx`
- One normalized `RizzdialError` for every API failure
- Pagination helper for list endpoints
- Python 3.9+

## Install

```bash
pip install rizzdial
```

## Authentication

Every request sends `Authorization: Bearer <token>`.

```python
from rizzdial import Rizzdial

# Option A: bring your own token
client = Rizzdial(token="eyJ...")

# Option B: obtain a token with credentials
client = Rizzdial.login("you@example.com", "secret")
print(client.get_token())  # persist it if you want to reuse it
```

Custom environment:

```python
client = Rizzdial(
    token="...",
    base_url="https://staging.rizzdial.com/api",  # default: https://rizzdial.com/api
    timeout=60.0,                                  # default: 30.0
)
```

## Usage

### Contacts

```python
fields = client.contacts.fields()
page = client.contacts.list(per_page=20)

# Iterate every contact across all pages
for contact in client.contacts.list_all(per_page=30):
    print(contact["phone_number"])

added = client.contacts.add({
    "phone_number": "+15551234567",
    "powerlist_id": 12,
    "first_name": "Jane",
})
contact = client.contacts.get(added["contact_id"])
```

### AI Agents

```python
agents = client.ai_agents.list()
agent = client.ai_agents.get("agent_abc123")

created = client.ai_agents.create({
    "agent_name": "Sales Qualifier",
    "general_prompt": "You are a friendly sales assistant...",
})

# Trigger an outbound AI call
client.ai_agents.create_call(
    created["data"]["agent_id"],
    "+15551234567",
    first_name="Jane",
)
```

### AI Phone Numbers

```python
numbers = client.ai_numbers.list()
found = client.ai_numbers.search(area_code="205", country="US")
client.ai_numbers.purchase({"phone_token": "..."})
client.ai_numbers.assign("MQ==", "agent_abc123", type="inbound")
```

### Workflows

```python
workflows = client.workflows.list()
wf = client.workflows.create({"name": "Lead follow-up", "status": "draft"})
client.workflows.update_status("wf_id", "active")
client.workflows.enroll_contact("wf_id", "contact_id")
logs = client.workflows.execution_logs(status="All")
```

### Dashboard

```python
summary = client.dashboard.summary(date_range="Last 7 Days")
pickup = client.dashboard.pickup_rate(
    date_range="Custom", start_date="2026-06-01", end_date="2026-06-30"
)
dispositions = client.dashboard.filter_dispositions()["dispositions"]
```

### Other resources

```python
client.powerlists.list()
client.powerlists.notes("MTI=")
client.tags.contact()
client.tags.powerlist()
client.dispositions.list()
client.campaigns.voice()
client.templates.sms()
client.templates.voice()
client.auth.validate()  # verify token / whoami
```

## Error handling

```python
from rizzdial import RizzdialError

try:
    client.contacts.get("bad-id")
except RizzdialError as error:
    print(error.status)   # HTTP status (e.g. 404)
    print(error.code)     # API error code, when provided
    print(error.message)  # human-readable message
    print(error.body)     # raw response body
```

## Notes on the API

- Many IDs are base64-encoded strings (e.g. `"MQ=="`); pass them back exactly as received.
- List endpoints accept `per_page` (default 15, max 30 on most endpoints) and `page`.
- `contacts.add` upserts by phone number: an existing contact with the same number is updated.

## License

MIT
