campaign
konigle.models.comm.campaign
¶
Campaign models for the Konigle SDK.
Campaign configuration for sending messages across multiple channels. Currently supports email campaigns with plans for WhatsApp, SMS, etc.
BaseCampaign
¶
Bases: BaseModel
Base campaign model with shared fields.
audience = Field(title='Audience ID', description='Target audience segment for this campaign.')
class-attribute
instance-attribute
¶
Target audience segment for this campaign.
channel_type = Field(default='email', title='Channel Type', description='Type of channel for this campaign (email, etc.).')
class-attribute
instance-attribute
¶
Type of channel for this campaign (email, etc.).
description = Field(default='', title='Description', description='Description of the campaign purpose.')
class-attribute
instance-attribute
¶
Description of the campaign purpose.
email_channel = Field(default=None, title='Email Channel ID', description='Channel to use for sending emails. Required for email campaigns.')
class-attribute
instance-attribute
¶
Channel to use for sending emails. Required for email campaigns.
email_template = Field(default=None, title='Email Template ID', description='Email template to use. Required for email campaigns.')
class-attribute
instance-attribute
¶
Email template to use. Required for email campaigns.
execution_duration_minutes = Field(default=None, title='Execution Duration (Minutes)', description='Duration in minutes over which to spread campaign sends (max 1440). Null = send as fast as possible while honoring channel rate limit.', ge=1, le=1440)
class-attribute
instance-attribute
¶
Duration in minutes over which to spread campaign sends.
from_email = Field(default='', title='From Email', description='Override from email (uses channel default if empty).')
class-attribute
instance-attribute
¶
Override from email (uses channel default if empty).
from_name = Field(default='', title='From Name', description='Override from name (uses channel default if empty).', max_length=255)
class-attribute
instance-attribute
¶
Override from name (uses channel default if empty).
name = Field(title='Campaign Name', description='Name of the campaign.', max_length=255)
class-attribute
instance-attribute
¶
Name of the campaign.
reply_to_email = Field(default='', title='Reply-To Email', description='Override reply-to email (uses channel default if empty).')
class-attribute
instance-attribute
¶
Override reply-to email (uses channel default if empty).
reply_to_name = Field(default='', title='Reply-To Name', description='Override reply-to name (uses channel default if empty).', max_length=255)
class-attribute
instance-attribute
¶
Override reply-to name (uses channel default if empty).
scheduled_at = Field(default=None, title='Scheduled At', description='When to send the campaign (null for immediate send).')
class-attribute
instance-attribute
¶
When to send the campaign (null for immediate send after starting).
utm_code = Field(default='', title='UTM Code', description='UTM campaign code for tracking performance in analytics.', max_length=100)
class-attribute
instance-attribute
¶
UTM campaign code for tracking performance in analytics.
Campaign
¶
Bases: BaseCampaign, TimestampedResource
Campaign configuration for sending messages across multiple channels.
Currently supports email campaigns. Designed to support additional channels (WhatsApp, SMS, etc.) in the future.
execution = Field(default=None, title='Execution Details', description='Execution tracking details (available in detail view).')
class-attribute
instance-attribute
¶
Execution tracking details (available in detail view).
ltv = Field(default=None, title='Lifetime Value', description='Lifetime value (revenue) generated by this campaign.', max_digits=12, decimal_places=2)
class-attribute
instance-attribute
¶
Lifetime value (revenue) generated by this campaign.
ltv_currency = Field(default='USD', title='LTV Currency', description='Currency code for lifetime value (ISO 4217).', max_length=3)
class-attribute
instance-attribute
¶
Currency code for lifetime value (ISO 4217).
status = Field(default='draft', title='Status', description='Current status of the campaign.')
class-attribute
instance-attribute
¶
Current status of the campaign.
CampaignAddLTV
¶
Bases: BaseModel
Model for adding LTV to a campaign.
Records revenue generated from a specific contact purchase and updates both campaign and contact LTV.
contact_email = Field(default=None, title='Contact Email', description='Email address of the contact who made the purchase. Optional if tracking aggregate campaign revenue.')
class-attribute
instance-attribute
¶
Email address of the contact who made the purchase.
currency = Field(title='Currency', description='Currency code (ISO 4217) for the LTV value.', max_length=3)
class-attribute
instance-attribute
¶
Currency code (ISO 4217) for the LTV value.
value = Field(title='LTV Value', description='Value to add to campaign and contact LTV (positive).', gt=0, max_digits=19, decimal_places=2)
class-attribute
instance-attribute
¶
Value to add to campaign and contact LTV (must be positive).
CampaignCreate
¶
CampaignCreateEmail
¶
Bases: BaseModel
Model for creating an email campaign with audience and template.
This is a hybrid API that creates a campaign along with its associated audience and email template in a single operation.
audience_name = Field(default='', title='Audience Name', description='Name for audience (defaults to campaign_name).', max_length=255)
class-attribute
instance-attribute
¶
Name for audience (defaults to campaign_name).
body_html = Field(title='HTML Body', description='HTML body content.')
class-attribute
instance-attribute
¶
HTML body content.
body_text = Field(default='', title='Text Body', description='Plain text body content.')
class-attribute
instance-attribute
¶
Plain text body content.
campaign_name = Field(title='Campaign Name', description='Name of the campaign.', max_length=255)
class-attribute
instance-attribute
¶
Name of the campaign.
contact_tags = Field(title='Contact Tags', description='List of tags to filter contacts for audience.')
class-attribute
instance-attribute
¶
List of tags to filter contacts for audience.
description = Field(default='', title='Description', description='Campaign description.')
class-attribute
instance-attribute
¶
Campaign description.
email_channel = Field(title='Email Channel Code', description='Code of email channel to use.', max_length=50)
class-attribute
instance-attribute
¶
Code of email channel to use.
execution_duration_minutes = Field(default=None, title='Execution Duration (Minutes)', description='Duration in minutes to spread campaign sends.', ge=1, le=1440)
class-attribute
instance-attribute
¶
Duration in minutes to spread campaign sends.
from_email = Field(default='', title='From Email', description='Override from email.')
class-attribute
instance-attribute
¶
Override from email.
from_name = Field(default='', title='From Name', description='Override from name. Required if account does not have default.', max_length=255)
class-attribute
instance-attribute
¶
Override from name. Required if account does not have default.
reply_to_email = Field(default='', title='Reply-To Email', description='Override reply-to email. Required if account does not have default.')
class-attribute
instance-attribute
¶
Override reply-to email. Required if account does not have default.
reply_to_name = Field(default='', title='Reply-To Name', description='Override reply-to name. Required if account does not have default.', max_length=255)
class-attribute
instance-attribute
¶
Override reply-to name. Required if account does not have default.
scheduled_at = Field(default=None, title='Scheduled At', description='When to send the campaign.')
class-attribute
instance-attribute
¶
When to send the campaign.
subject = Field(title='Email Subject', description='Email subject line.', max_length=255)
class-attribute
instance-attribute
¶
Email subject line.
template_name = Field(default='', title='Template Name', description='Name for email template (defaults to campaign_name).', max_length=255)
class-attribute
instance-attribute
¶
Name for email template (defaults to campaign_name).
utm_code = Field(default='', title='UTM Code', description='UTM campaign code for tracking.', max_length=100)
class-attribute
instance-attribute
¶
UTM campaign code for tracking.
CampaignExecution
¶
Bases: BaseModel
Track execution of a campaign with process and status.
Provides real-time tracking of campaign delivery progress, including send rates, delivery metrics, and error tracking.
cancelled_at = Field(default=None, title='Cancelled At', description='When the execution was cancelled (if applicable).')
class-attribute
instance-attribute
¶
When the execution was cancelled (if applicable).
completed_at = Field(default=None, title='Completed At', description='When execution completed.')
class-attribute
instance-attribute
¶
When execution completed.
error_message = Field(default='', title='Error Message', description='Error message if execution failed.')
class-attribute
instance-attribute
¶
Error message if execution failed.
expected_completion_at = Field(default=None, title='Expected Completion At', description='Expected completion time based on execution duration.')
class-attribute
instance-attribute
¶
Expected completion time based on execution duration.
last_run_at = Field(default=None, title='Last Run At', description='When the last run completed for calculating send rate.')
class-attribute
instance-attribute
¶
When the last run completed for calculating send rate.
next_run_at = Field(default=None, title='Next Run At', description='When to run the next execution (for HALTED executions).')
class-attribute
instance-attribute
¶
When to run the next execution (for HALTED executions).
paused_at = Field(default=None, title='Paused At', description='When the execution was paused (if applicable).')
class-attribute
instance-attribute
¶
When the execution was paused (if applicable).
resumed_at = Field(default=None, title='Resumed At', description='When the execution was last resumed after being paused.')
class-attribute
instance-attribute
¶
When the execution was last resumed after being paused.
started_at = Field(default=None, title='Started At', description='When execution started.')
class-attribute
instance-attribute
¶
When execution started.
status = Field(default='pending', title='Execution Status', description='Current execution status.')
class-attribute
instance-attribute
¶
Current execution status.
total_bounced = Field(default=0, title='Total Bounced', description='Number of messages bounced (from events).')
class-attribute
instance-attribute
¶
Number of messages bounced (from events).
total_clicked = Field(default=None, title='Total Clicked', description='Number of messages with clicks (from events).')
class-attribute
instance-attribute
¶
Number of messages with clicks (from events). NULL if not tracked.
total_complained = Field(default=0, title='Total Complained', description='Number of spam complaints (from events).')
class-attribute
instance-attribute
¶
Number of spam complaints (from events).
total_contacts = Field(default=0, title='Total Contacts', description='Total number of contacts to send to.')
class-attribute
instance-attribute
¶
Total number of contacts to send to.
total_delivered = Field(default=0, title='Total Delivered', description='Number of messages delivered (from events).')
class-attribute
instance-attribute
¶
Number of messages delivered (from events).
total_failed = Field(default=0, title='Total Failed', description='Number of messages that failed to send.')
class-attribute
instance-attribute
¶
Number of messages that failed to send.
total_opened = Field(default=None, title='Total Opened', description='Number of messages opened (from events).')
class-attribute
instance-attribute
¶
Number of messages opened (from events). NULL if not tracked.
total_sent = Field(default=0, title='Total Sent', description='Number of messages successfully sent.')
class-attribute
instance-attribute
¶
Number of messages successfully sent.
CampaignUpdate
¶
Bases: UpdateModel
Model for updating an existing campaign.
Note: ltv and ltv_currency are managed automatically by the system based on campaign performance and cannot be updated directly. Status transitions are handled by separate action endpoints.
Campaign can only be updated when in draft and scheduled states. This does not hold for name and description which can be updated at any time.
audience = Field(default=None, title='Audience ID', description='Target audience segment for this campaign.')
class-attribute
instance-attribute
¶
Target audience segment for this campaign.
description = Field(default=None, title='Description', description='Description of the campaign purpose.')
class-attribute
instance-attribute
¶
Description of the campaign purpose.
email_channel = Field(default=None, title='Email Channel ID', description='Channel to use for sending emails.')
class-attribute
instance-attribute
¶
Channel to use for sending emails.
email_template = Field(default=None, title='Email Template ID', description='Email template to use.')
class-attribute
instance-attribute
¶
Email template to use.
execution_duration_minutes = Field(default=None, title='Execution Duration (Minutes)', description='Duration in minutes over which to spread campaign sends (max 1440).', ge=1, le=1440)
class-attribute
instance-attribute
¶
Duration in minutes over which to spread campaign sends.
from_email = Field(default=None, title='From Email', description='Override from email.')
class-attribute
instance-attribute
¶
Override from email.
from_name = Field(default=None, title='From Name', description='Override from name.', max_length=255)
class-attribute
instance-attribute
¶
Override from name.
name = Field(default=None, title='Campaign Name', description='Name of the campaign.', max_length=255)
class-attribute
instance-attribute
¶
Name of the campaign.
reply_to_email = Field(default=None, title='Reply-To Email', description='Override reply-to email.')
class-attribute
instance-attribute
¶
Override reply-to email.
reply_to_name = Field(default=None, title='Reply-To Name', description='Override reply-to name.', max_length=255)
class-attribute
instance-attribute
¶
Override reply-to name.
scheduled_at = Field(default=None, title='Scheduled At', description='When to send the campaign.')
class-attribute
instance-attribute
¶
When to send the campaign.
utm_code = Field(default=None, title='UTM Code', description='UTM campaign code for tracking.', max_length=100)
class-attribute
instance-attribute
¶
UTM campaign code for tracking.