Campaign Module
Run email and SMS marketing campaigns with templates, automation flows, and detailed analytics.
Base URL: https://app.proign.com/[tenant]/campaign/api
Public Forms: https://app.proign.com/[tenant]/campaign/api/p
Overview
The Campaign module provides marketing automation:
- Contact management with import/export
- Static lists and dynamic segments
- Email campaigns with templates
- SMS marketing (TCPA compliant)
- Automation flows
- Surveys and form collection
- Comprehensive analytics
Key Features
Contact Management
Centralized contact database with lifecycle tracking:
- Import/Export - CSV bulk import, deduplication
- Smart Lists - Dynamic segments with SQL query builder
- Engagement Scoring - Automatic scoring based on opens, clicks, conversions
- Contact Lifecycle - Track stages from lead to customer
Campaign Tools
Create and optimize marketing campaigns:
- Subject Line Analyzer - AI-powered subject line scoring
- A/B Testing - Test subject lines, content, send times
- Send Optimization - Best-time delivery per recipient
- ROI Attribution - Track revenue generated per campaign
API Endpoints
Contacts
GET /api/[tenant]/contacts # List contacts
POST /api/[tenant]/contacts # Create contact
GET /api/[tenant]/contacts/[id] # Get contact
PATCH /api/[tenant]/contacts/[id] # Update contact
DELETE /api/[tenant]/contacts/[id] # Delete contact
Lists & Segments
# Static Lists
GET /api/[tenant]/lists # List all lists
POST /api/[tenant]/lists # Create list
GET /api/[tenant]/lists/[id] # Get list details
PUT /api/[tenant]/lists/[id] # Update list
DELETE /api/[tenant]/lists/[id] # Delete list
GET /api/[tenant]/lists/[id]/contacts # Get list contacts
POST /api/[tenant]/lists/[id]/contacts # Add contacts to list
DELETE /api/[tenant]/lists/[id]/contacts # Remove from list
# Dynamic Segments
GET /api/[tenant]/segments # List segments
POST /api/[tenant]/segments # Create segment
GET /api/[tenant]/segments/[id] # Get segment with contacts
PUT /api/[tenant]/segments/[id] # Update segment rules
DELETE /api/[tenant]/segments/[id] # Delete segment
Campaigns
GET /api/[tenant]/campaigns # List campaigns
POST /api/[tenant]/campaigns # Create campaign
GET /api/[tenant]/campaigns/[id] # Get campaign details
PUT /api/[tenant]/campaigns/[id] # Update campaign
DELETE /api/[tenant]/campaigns/[id] # Delete campaign
POST /api/[tenant]/campaigns/[id]/send # Send campaign
GET /api/[tenant]/campaigns/[id]/analytics # Campaign stats
GET /api/[tenant]/campaigns/[id]/recipients # List recipients
Templates
# Email Templates
GET /api/[tenant]/templates/email # List email templates
POST /api/[tenant]/templates/email # Create template
GET /api/[tenant]/templates/email/[id] # Get template
PUT /api/[tenant]/templates/email/[id] # Update template
DELETE /api/[tenant]/templates/email/[id] # Delete template
# SMS Templates
GET /api/[tenant]/templates/sms # List SMS templates
POST /api/[tenant]/templates/sms # Create template
PUT /api/[tenant]/templates/sms/[id] # Update template
DELETE /api/[tenant]/templates/sms/[id] # Delete template
Automation Flows
GET /api/[tenant]/flows # List flows
POST /api/[tenant]/flows # Create flow
GET /api/[tenant]/flows/[id] # Get flow details
PUT /api/[tenant]/flows/[id] # Update flow
DELETE /api/[tenant]/flows/[id] # Delete flow
GET /api/[tenant]/flows/[id]/enrollments # List enrolled contacts
POST /api/[tenant]/flows/[id]/enrollments # Enroll contacts
Surveys
GET /api/[tenant]/surveys # List surveys
POST /api/[tenant]/surveys # Create survey
GET /api/[tenant]/surveys/[id] # Get survey
PUT /api/[tenant]/surveys/[id] # Update survey
DELETE /api/[tenant]/surveys/[id] # Delete survey
GET /api/[tenant]/surveys/[id]/responses # Get survey responses
Analytics & Tracking
GET /api/[tenant]/analytics # Dashboard overview
GET /api/[tenant]/analytics/advanced # Advanced metrics
GET /api/[tenant]/track/open # Email open tracking pixel
GET /api/[tenant]/track/click # Click tracking redirect
Public Endpoints (Forms & Surveys)
# Public contact collection (no auth)
POST /api/p/[tenant]/contacts # Submit contact form
POST /api/p/[tenant]/consent/verify # Verify consent
POST /api/p/[tenant]/consent/confirm # Confirm subscription
# Public surveys
GET /api/p/[tenant]/surveys/[id] # Get survey (public)
PUT /api/p/[tenant]/surveys/[id]/respond # Submit response
# Unsubscribe
POST /api/[tenant]/public/unsubscribe # Unsubscribe contact
Settings & Webhooks
GET /api/[tenant]/settings # Get settings
PUT /api/[tenant]/settings # Update settings
# Webhooks (internal)
POST /api/webhooks/resend # Resend email events
POST /api/webhooks/telnyx # Telnyx SMS events
Request Examples
Create Contact
POST /api/[tenant]/contacts
Content-Type: application/json
{
"email": "john@example.com",
"first_name": "John",
"last_name": "Smith",
"phone": "+1234567890",
"tags": ["customer", "vip"],
"custom_fields": {
"company": "Acme Inc"
}
}Create Campaign
POST /api/[tenant]/campaigns
Content-Type: application/json
{
"name": "Q1 Newsletter",
"type": "email",
"subject": "What's new this quarter",
"template_id": "tmpl_abc123",
"from_name": "Acme Marketing",
"from_email": "news@acme.com",
"list_ids": ["list_123", "list_456"],
"segment_ids": ["seg_789"]
}Campaign Status Flow
Each campaign moves through these statuses:
| Status | Description |
|---|---|
draft | Campaign created, content being prepared |
scheduled | Send time set, waiting for delivery window |
sending | Messages being delivered through the queue |
sent | All messages delivered, analytics collecting |
cancelled | Stopped before all messages were sent |
Analytics Metrics
Track campaign performance with these metrics:
| Metric | Description |
|---|---|
| Delivery Rate | Percentage of messages successfully delivered |
| Open Rate | Unique opens divided by delivered count |
| Click Rate | Unique link clicks divided by delivered count |
| Bounce Rate | Hard and soft bounces as percentage of total sent |
| Unsubscribe Rate | Opt-outs triggered by this campaign |
| Engagement Heatmap | Visual map of which links received the most clicks |