Skip to content

CampaignService

Manages the full lifecycle of communication campaigns — from creation through delivery to completion.

MethodDescription
CreateCampaignCreate a new campaign in draft status
StartCampaignLaunch a draft campaign
GetCampaignRetrieve a campaign by ID
ListCampaignsList campaigns for the organization
UpdateCampaignUpdate a draft campaign
CancelCampaignCancel an active campaign
ListDeliveriesList deliveries for a campaign

Create a new campaign in CREATED (draft) status.

Authorization: Requires MANAGE_CAMPAIGNS permission

FieldTypeDescription
namestringInternal name for the campaign. Max 200 characters.
titlestringUser-facing title shown in notifications. Max 200 characters.
template_idstringID of the template to use. UUID format.
template_versionint32Pinned template version.
sender_namestringDisplay name for the message sender. Max 200 characters.
workflowWorkflowDefinitionWorkflow DAG definition.
audienceAudienceMember[]Target audience with optional per-user variables.
FieldTypeDescription
campaignCampaignThe created campaign.

TypeScript (Connect-Web)

const response = await campaignClient.createCampaign({
name: "Q1 Security Update",
title: "Important Security Changes",
templateId: "template-uuid",
templateVersion: 1,
senderName: "Security Team",
audience: [
{ userId: "user-1", variables: { name: "Alice" } },
{ userId: "user-2", variables: { name: "Bob" } },
],
});

Go (gRPC)

resp, err := campaignClient.CreateCampaign(ctx, &pidgrv1.CreateCampaignRequest{
Name: "Q1 Security Update",
Title: "Important Security Changes",
TemplateId: "template-uuid",
TemplateVersion: 1,
SenderName: "Security Team",
Audience: []*pidgrv1.AudienceMember{
{UserId: "user-1", Variables: map[string]string{"name": "Alice"}},
{UserId: "user-2", Variables: map[string]string{"name": "Bob"}},
},
})

Launch a draft campaign. Starts the workflow engine.

Authorization: Requires MANAGE_CAMPAIGNS permission

FieldTypeDescription
idstringCampaign ID to start.
FieldTypeDescription
campaignCampaignThe updated campaign with ACTIVE status.

Retrieve a campaign by ID.

Authorization: Requires VIEW_CAMPAIGNS permission

FieldTypeDescription
idstringCampaign ID.
FieldTypeDescription
campaignCampaignThe campaign.

List campaigns for the organization with pagination.

Authorization: Requires VIEW_CAMPAIGNS permission

FieldTypeDescription
paginationPaginationPagination parameters.
FieldTypeDescription
campaignsCampaign[]List of campaigns.
paginationPaginationMetaPagination metadata.

Update a draft campaign. Only CREATED status campaigns can be updated.

Authorization: Requires MANAGE_CAMPAIGNS permission

FieldTypeDescription
idstringCampaign ID.
namestringUpdated name.
titlestringUpdated title.
template_idstringUpdated template ID.
template_versionint32Updated template version.
sender_namestringUpdated sender name.
FieldTypeDescription
campaignCampaignThe updated campaign.

Cancel an active campaign. Stops the workflow — no further reminders or webhook calls.

Authorization: Requires MANAGE_CAMPAIGNS permission

FieldTypeDescription
idstringCampaign ID to cancel.
FieldTypeDescription
campaignCampaignThe cancelled campaign.

List deliveries for a specific campaign.

Authorization: Requires VIEW_CAMPAIGNS permission

FieldTypeDescription
campaign_idstringCampaign ID.
paginationPaginationPagination parameters.
FieldTypeDescription
deliveriesDelivery[]List of deliveries.
paginationPaginationMetaPagination metadata.
FieldTypeDescription
idstringUnique identifier.
namestringInternal name.
titlestringUser-facing title.
template_idstringTemplate ID.
template_versionint32Pinned template version.
sender_namestringSender display name.
statusCampaignStatusCurrent status.
workflowWorkflowDefinitionWorkflow DAG.
created_atTimestampCreation timestamp.
started_atTimestampLaunch timestamp.
completed_atTimestampCompletion timestamp.
FieldTypeDescription
idstringUnique identifier.
campaign_idstringParent campaign ID.
user_idstringRecipient user ID.
statusDeliveryStatusCurrent delivery status.
messageMessageThe rendered message content.
sent_atTimestampWhen the notification was sent.
read_atTimestampWhen the user opened the message.
acknowledged_atTimestampWhen the user acknowledged.