createCampaign
Create a new message campaign with scheduled messages.Input Parameters
The WhatsApp group ID or contact ID
The WhatsApp group name or contact name
The WhatsApp session ID to use for sending messages
Optional campaign title
Optional contribution target amount
Campaign start date in ISO format (e.g., “2024-01-01”)
Campaign end date in ISO format (e.g., “2024-12-31”)
Time to send messages in HH:mm format (e.g., “09:30”)
Time zone for scheduling messages
Message template. Use
{days_left} placeholder for dynamic days remaining. Separate multiple messages with asterisks (*) for recurring campaigns.If true, excludes campaign metadata from message content
Whether the campaign sends messages on a recurring schedule
Recurrence pattern for the campaignOptions:
DAILY, WEEKLY, SEMI_MONTHLY, MONTHLY, SEMI_ANNUALLY, ANNUALLYType of audience for the campaignOptions:
groups, individualsResponse
Indicates whether the campaign was created successfully
The unique identifier of the created campaign
Example
getCampaigns
Retrieve all active campaigns for the current user (campaigns with future scheduled messages).Response
Array of campaign objects
Campaign ID
Campaign title
Target contribution amount
Campaign start date
Campaign end date
Scheduled send time in UTC
Campaign time zone
Message template
Campaign status
Campaign creation timestamp
Whether campaign is recurring
Recurrence pattern
Example
getCompletedCampaigns
Retrieve all completed campaigns for the current user (all messages sent or past scheduled time).Response
Same structure asgetCampaigns, but returns campaigns where all messages have been sent or are past their scheduled time.
Example
updateCampaign
Update an existing campaign. Only campaigns with no sent messages can be edited.Input Parameters
The ID of the campaign to update
Optional campaign title
Optional contribution target amount
Campaign start date in ISO format
Campaign end date in ISO format
Time to send messages in HH:mm format
Time zone for scheduling messages
Message template with optional placeholders
Whether the campaign sends messages on a recurring schedule
If true, excludes campaign metadata from message content
Recurrence patternOptions:
DAILY, WEEKLY, SEMI_MONTHLY, MONTHLY, SEMI_ANNUALLY, ANNUALLYType of audienceOptions:
groups, individualsResponse
Indicates whether the campaign was updated successfully
The unique identifier of the updated campaign
Example
Error Cases
- “Campaign not found or access denied”: Campaign doesn’t exist or user doesn’t have permission
- “Cannot edit campaign with messages that have already been sent”: At least one message has been sent
- “Invalid time format”: messageTime doesn’t match HH:mm format
- “End date must be after start date”: Invalid date range
deleteCampaign
Soft delete a campaign and all its associated messages.Input Parameters
The ID of the campaign to delete
Response
Indicates whether the campaign was deleted successfully