AssignSurveyToCampaign attaches a survey version to a campaign on a channel.
POST/api/v1/surveys/assignments
Each assignment defines how the survey is delivered: which channel,
when to trigger relative to the primary interaction, how many retry
attempts are allowed, and whether completion is mandatory. A campaign
may have multiple assignments, one per (channel_type, trigger_point)
combination.
Parameters
- survey_id: Required, survey to assign (> 0).
- campaign_id: Required, target campaign (> 0).
- channel_type: Required, delivery channel. One of:
voice: IVR-delivered survey over a voice call.whatsapp: WhatsApp Business message flow.sms: SMS message flow.webchat: Embedded web chat survey.email: Email-delivered survey link.
- trigger_point: Required, when to deliver. One of:
post_interaction: After the primary interaction ends.during_interaction: Mid-interaction while the agent is engaged.scheduled: At a later time controlled bytrigger_delay_seconds.
- trigger_delay_seconds: Optional, delay in seconds before delivery.
For
scheduledthis is relative to interaction end; for other trigger points this pauses before prompting. - mandatory: If true, participants must complete the survey; declines
are retried up to
max_attempts. - survey_version_id: Optional, pins the assignment to a specific version.
If omitted, the survey's current
active_version_idis used. - max_attempts: Maximum retry attempts on decline/expire (default 1).
Example
{
"survey_id": 42,
"campaign_id": 7,
"channel_type": "voice",
"trigger_point": "post_interaction",
"trigger_delay_seconds": 5,
"mandatory": false,
"max_attempts": 2
}
Errors
- NOT_FOUND: Survey, campaign, or version does not exist.
- INVALID_ARGUMENT: Invalid channel_type, trigger_point, or channel mismatch with the campaign's type.
- ALREADY_EXISTS: An active assignment already exists for this
(campaign_id, channel_type)pair. Update or remove it first.
Request
Responses
- 200
- default
A successful response.
An unexpected error response.