ads_associate_optimization_rules_to_campaign
Attach Sponsored Products bid optimization rules to a campaign — a rule changes nothing until it is associated.
destructiveAmazon Adsads.sp
Amazon Ads API · AssociateOptimizationRulesToCampaign · POST /sp/campaigns/{campaignId}/optimizationRules Docs: https://advertising.amazon.com/API/docs/en-us/sponsored-products/3-0/openapi/prod#tag/Optimization-Rules/operation/AssociateOptimizationRulesToCampaign Gate: approve — interactive: show the change (Amazon's preview first where one exists), wait for an explicit approve; autopilot: only when the seller's own words asked for this change; otherwise ask.
Call it
In an AI client (MCP)
{
"name": "ads_associate_optimization_rules_to_campaign",
"arguments": {
"store": "myStore-US",
"countryCode": "<countryCode>",
"campaignId": "<campaignId>",
"body": {}
}
}From code (Tool API)
curl -X POST https://api.sellersheetai.com/api/v1/tools/ads_associate_optimization_rules_to_campaign \
-H "Authorization: Bearer $SELLERSHEET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"store":"myStore-US","countryCode":"<countryCode>","campaignId":"<campaignId>","body":{}}'Early access — the Tool API is open on request, contact us.
Arguments
| Name | Type | Description |
|---|---|---|
storerequired | string | the store ref `<store>-<CC>` (name-country, e.g. 'myStore-US') — one of get_user_context's store_refs, verbatim. |
countryCoderequired | string | the Ads profile's 2-letter country code (e.g. 'US'). |
campaignIdrequired | string | the SP campaign the rules attach to. |
bodyrequired | object | {optimizationRuleIds: ["amzn1.ads-rule.m.xxx"]}. |
apiVersion | string | v1 (default) | v2.Default: "v1" |
Result
Every tool answers {notification, data, human_action}; data carries:
- 207, one result per item; an item whose code is not "Ok" (or that is listed under error / failures) failed — read its details.
data.failed— [{index, optimizationRuleId, code, details}] for every item Amazon did not confirm. ALWAYS relay this verbatim.
Gotchas
- A campaign that already carries a rule from ads_create_optimization_rule (the campaign-optimization / rule-based-bidding API) REFUSES association: "Campaign has performance based rule enabled and therefore cannot associate an Intraday bidding rule or performance based rule." The two automation models are mutually exclusive per campaign — pick one and say which.
- Changes take up to 24 hours to take effect.