Set campaign recipients
Choose who a draft campaign goes to: a whole list, a saved segment or a tag.
MCP tool emailoctopus_write → set_campaign_recipients
Fills the "Sending to" field of a draft campaign. audience is list, segment or tag. A campaign goes to one list at a time, so list_id is required and segment or tag is a filter inside it. For a scheduled campaign, a segment or tag is checked right before sending, so contacts added or removed after scheduling are counted at that moment. The tool only sets the audience and reaches no one.
Parameters
| Name | Type | Description |
|---|---|---|
| campaign_id string required | string | Campaign ID from list_campaigns. |
| audience enum required | enum | list, segment or tag. |
| list_id string required | string | List ID from list_lists. |
| segment string | string | Segment name from list_segments; with audience segment. |
| tag string | string | Tag name; with audience tag. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "emailoctopus_write",
"arguments": {
"operation": "set_campaign_recipients",
"arguments": {
"campaign_id": "campaign_8c41d2",
"audience": "list",
"list_id": "list_8c41d2"
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"campaign_id": "d5e8a3b1-62c9-4e70-8a14-9f0b7c2d6e83",
"audience": "segment",
"list": "Newsletter",
"segment": "Did not open: Autumn offer",
"status": "draft"
},
"isError": false
}