Draft a campaign
draftCampaignWrite a campaign for a segment and leave it as a DRAFT for review. Nothing is sent - a human opens it in Email → Campaigns and decides. Preview the audience first so the brief matches who would actually receive it. Kooga writes it from the brief, featuring the products given in productIds (all of them, as one grid) or ones that fit the brief. Or lay it out yourself in blocks, with its subject: when the person describes the email section by section, with images, chosen products or prices of their own, the body is exactly those blocks. It is set up to test two subject lines on a sample and send the winner to the rest, unless abTest is false. readCampaign shows the body as saved. Each call is a new campaign: to change one already drafted, use updateCampaign with its broadcastId instead, and deleteCampaign for one not wanted.
Only for a workspace with subscribed email contacts.
A change inside Kooga: it runs at once, as the person.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Internal name for the campaign | |
| brief | Yes | Goal and angle, grounded in real numbers. Never invent discounts, prices, stock or urgency. With `blocks`, only kept as what the campaign is for. | |
| abTest | No | Test two subject lines on a sample of the audience first, then send the winner to the rest | |
| blocks | No | The body, top to bottom, exactly as it should read. No footer: the sender line and the unsubscribe link are added under every email. readCampaign shows a body as it is saved | |
| subject | No | The subject line; needed with `blocks`, written from the brief otherwise. Merge tags are filled per reader: {{first_name}} or {{first_name|fallback}}, with first_name, last_name, name, city, country | |
| subjectB | No | The second subject line to test; left out, one with a different angle is written | |
| preheader | No | The line shown after the subject in the inbox, with `blocks` | |
| productIds | No | Products to feature, by the store's own id (storeId from readProducts), all shown as one grid. Left out, the draft picks products that fit the brief. Not with `blocks`: chosen products go in its products block | |
| segmentKey | Yes | Which audience: 'all', a segment's key, or a segment's id, exactly as readSegments gives them | |
| abTestHours | No | How long the test runs before the winner goes to the rest | |
| workspaceId | No | The workspace, as listWorkspaces gives it (its id or slug). Leave it out when this connection reaches one workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | ||
| subject | Yes | ||
| subjectB | Yes | The subject tested against it; null when there is no test | |
| broadcastId | Yes | ||
| productsLeftOut | Yes | Chosen products that are not in the email: unknown here, out of stock, without a page or not on sale |