Attach campaign sources
Campaigns
Attach Campaign Sources
Connect Audiences and/or Segments to a campaign. Only the links are stored in campaign_audience_sources; no contacts are copied at attach time — connected contacts are materialized in the background.
POST
Attach campaign sources
Use this endpoint to connect Audiences and/or Segments to a campaign. Only the links are stored — no contacts are copied at attach time; connected contacts are materialized in the background.
Endpoint
POST/campaign/attach-sources
Content-Type: application/json
Authentication: Required (workspace auth)
Request Body
Response
Behavior
- Both
audience_idsandsegment_idsare deduplicated and coerced to numbers; non-numeric or zero values are dropped. - Each ID is verified to belong to the caller’s company and workspace, and to not be soft-deleted. Any ID that doesn’t resolve fails the whole request.
- If the campaign’s agent has required input fields (from its latest flow), every attached audience — and every attached segment’s parent audience — must already contain those input variables. Otherwise the attach is blocked, since the agent would otherwise dial contacts missing the data it needs.
- Idempotent: re-attaching a source that was previously detached reactivates it instead of creating a duplicate link.
- Attaching a source immediately queues contact materialization in the background; it does not block on that work completing.
Error Cases
Example cURL
Headers
API token for authentication
Body
application/json

