Skip to content

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: ContactCreate

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: ContactUpdateLTV

RETURNS DESCRIPTION
Contact

Updated contact with new LTV

RAISES DESCRIPTION
APIError

If the API request fails

Example
from konigle.models.comm import ContactUpdateLTV
from decimal import Decimal

ltv_data = ContactUpdateLTV(
    email="customer@example.com",
    value=Decimal("149.99"),
    currency="USD",
)
contact = await client.contacts.update_ltv(ltv_data)
print(f"Contact LTV: {contact.ltv} {contact.ltv_currency}")

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: ContactCreate

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: ContactUpdateLTV

RETURNS DESCRIPTION
Contact

Updated contact with new LTV

RAISES DESCRIPTION
APIError

If the API request fails

Example
from konigle.models.comm import ContactUpdateLTV
from decimal import Decimal

ltv_data = ContactUpdateLTV(
    email="customer@example.com",
    value=Decimal("149.99"),
    currency="USD",
)
contact = client.contacts.update_ltv(ltv_data)
print(f"Contact LTV: {contact.ltv} {contact.ltv_currency}")