Upsert Campaign Plan
upsert_campaign_planCreate or update a campaign plan from an agency's media plan or brief. The plan is keyed by (externalSource, externalId) — the platform the campaign id belongs to and its id there — so re-sending the same campaign updates it, and an identical call changes nothing (Outcome=Unchanged). It is always saved as a Draft: it does not change the forecast until a planner previews and applies it in Spark, and a plan that is already Applied or Retired is refused (CONFLICT). The agency's stated lift is the plan's conservative/expected/optimistic scenario (percent by default, or additional units). itemSkus are every product expected to move; heroSkus are the featured ones (added to the plan items automatically); the rest are expected to see halo. The owning client is derived from the items. The preview carries an advisory estimate calibration: how far this brand's completed campaigns' stated lifts have run from what sold (median and range, once enough are measured), with your lift calibrated, and the brand's measured campaign history for this kind and channels (peak lift, pull-forward, lift per 1k of spend, with a suggested range; association, not cause). Neither changes your numbers unless you set adoptCalibration or adoptCampaignHistory.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"externalSource": "<externalSource>",
"externalId": "<externalId>",
"name": "<name>",
"campaignKind": "<campaignKind>",
"startsOn": "<startsOn>",
"endsOn": "<endsOn>",
"itemSkus": "<itemSkus>"
},
"name": "upsert_campaign_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Plan name, max 200 characters. | |
| notes | No | Free-text notes, max 4000 characters. | |
| offer | No | The campaign's offer: kind, value, minimum, code or automatic, eligibility, stacking and the SKUs it covers. Omit for none. When sent, offerKind/offerValue/offerCurrency are ignored. | |
| endsOn | Yes | Last campaign day (inclusive), yyyy-MM-dd. | |
| markets | No | Target markets as ISO 3166 codes, e.g. US, GB, US-CA. | |
| preview | No | Step 1 of the required two-step write: set true to validate and receive a structured preview (Created/Updated/Unchanged, per-field changes, resolved items, warnings) plus a single-use previewReceipt. Nothing is saved until the commit call. | |
| audience | No | Acquisition, Retention or Mixed. | |
| channels | No | One row per channel with its planned spend and currency. | |
| clientId | No | Required for operator (unpinned) credentials on 3PL tenants: the client (GUID) the campaign's items belong to — get ids from list_clients. Client-pinned credentials omit this; the credential decides. | |
| heroSkus | No | SKUs of the featured (hero) products; they are added to the plan items. | |
| itemSkus | Yes | SKUs of every product the campaign is expected to move (max 50). | |
| liftMode | No | How the stated lift is expressed: Percent (default) or AdditionalUnits (total extra units across the plan items). | |
| startsOn | Yes | First campaign day, yyyy-MM-dd, in the workspace's time zone. | |
| decayMode | No | Sustained (default: full lift through the window) or Decaying (fades to neutral). | |
| offerKind | No | Deprecated, use offer. None, PercentOff, AmountOff, Bundle or FreeShipping. Omitted (with no offer) means no offer; restating what a read returned keeps the stored offer's other details. | |
| externalId | Yes | The campaign's id in externalSource. Unique only within that source. | |
| offerValue | No | Deprecated, use offer. PercentOff: percent (0-100]. AmountOff: amount off. Bundle: bundle price. | |
| campaignKind | Yes | PaidSocial, PaidSearch, EmailSms, Influencer, Affiliate, Pr, SaleEvent, RetailPlacement or Other. | |
| liftExpected | No | Agency's expected lift — the default scenario a planner applies. | |
| plannedReach | No | Planned reach (impressions or recipients). | |
| offerCurrency | No | Deprecated, use offer. ISO 4217 currency for an AmountOff or Bundle price. | |
| externalSource | Yes | The platform or tool the campaign id belongs to, e.g. meta_ads, google_ads, klaviyo or an agency's own planner. Letters, digits, '.', '_', '-', ':'. | |
| idempotencyKey | No | Caller-generated idempotency key; required with previewReceipt to commit. | |
| liftOptimistic | No | Agency's optimistic lift. | |
| previewReceipt | No | Step 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused. | |
| informationOnly | No | True records the campaign without any forecast effect (never previewable/applied). | |
| adoptCalibration | No | Explicitly adopt the estimate calibration shown in the preview: the lift values you send stay your stated lift and are recorded as such, and the plan stores them scaled by the calibration. Refused when no calibration is available yet. Default false: your numbers are stored as sent. | |
| liftConservative | No | Agency's conservative lift. Percent values stay within -75 and 300. | |
| plannedReachMetric | No | What plannedReach counts: Impressions or Recipients. | |
| adoptCampaignHistory | No | Explicitly adopt the measured campaign history shown in the preview (preview.campaignHistory.suggested) in place of your lift: the lift values you send stay recorded as your stated lift, and the plan stores the history's suggested percent range. Refused when the history is insufficient, or together with adoptCalibration. Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| plan | No | ||
| outcome | No | ||
| preview | No | ||
| expiresAt | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| correlationId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| idempotentReplay | No |