contact
konigle.managers.comm.contact
¶
Contact managers for the Konigle SDK.
This module provides managers for contact resources, enabling contact management operations including CRUD operations and filtering.
AsyncContactManager
¶
Bases: BaseContactManager, BaseAsyncManager
Asynchronous manager for contact resources.
create(data)
async
¶
Create a new contact.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Contact creation data including all required fields
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Contact
|
Created contact instance with Active Record capabilities |
Example
from konigle.models.comm import (
ContactCreate,
MarketingConsent,
)
contact_data = ContactCreate(
email="john@example.com",
first_name="John",
last_name="Doe",
phone="+1234567890",
source="lead",
tags=["newsletter", "webinar"],
marketing_consent=MarketingConsent(
email=True,
sms=False,
whatsapp=True,
),
)
contact = await client.contacts.create(contact_data)
print(f"Created contact: {contact.email}")
update_ltv(data)
async
¶
Update contact LTV (Lifetime Value) from a purchase.
Adds revenue to a contact's lifetime value based on email address. This is a non-detail interface that doesn't require a contact ID.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
LTV update data including email, value, and currency
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Contact
|
Updated contact with new LTV |
| RAISES | DESCRIPTION |
|---|---|
APIError
|
If the API request fails |
BaseContactManager
¶
Base class for contact managers with shared configuration.
base_path = '/reachout/api/v1/contacts'
class-attribute
instance-attribute
¶
The API base path for this resource type.
filter_class = ContactFilters
class-attribute
instance-attribute
¶
The filter model class for this resource type.
resource_class = Contact
class-attribute
instance-attribute
¶
The resource model class this manager handles.
resource_update_class = ContactUpdate
class-attribute
instance-attribute
¶
The model class used for updating resources.
ContactManager
¶
Bases: BaseContactManager, BaseSyncManager
Synchronous manager for contact resources.
create(data)
¶
Create a new contact.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Contact creation data including all required fields
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Contact
|
Created contact instance with Active Record capabilities |
Example
from konigle.models.comm import (
ContactCreate,
MarketingConsent,
)
contact_data = ContactCreate(
email="john@example.com",
first_name="John",
last_name="Doe",
phone="+1234567890",
source="lead",
tags=["newsletter", "webinar"],
marketing_consent=MarketingConsent(
email=True,
sms=False,
whatsapp=True,
),
)
contact = client.contacts.create(contact_data)
print(f"Created contact: {contact.email}")
update_ltv(data)
¶
Update contact LTV (Lifetime Value) from a purchase.
Adds revenue to a contact's lifetime value based on email address. This is a non-detail interface that doesn't require a contact ID.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
LTV update data including email, value, and currency
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Contact
|
Updated contact with new LTV |
| RAISES | DESCRIPTION |
|---|---|
APIError
|
If the API request fails |