ads_sp_update_optimization_rules
Update a Sponsored Products bid optimization rule — Amazon replaces the rule, it does not merge, so send the FULL rule object(s) including optimizationRuleId.
destructiveAmazon Adsads.sp
Read the current rule first with ads_search_optimization_rules. Amazon Ads API · UpdateOptimizationRules · PUT /sp/rules/optimization Docs: https://advertising.amazon.com/API/docs/en-us/sponsored-products/3-0/openapi/prod#tag/Optimization-Rules/operation/UpdateOptimizationRules 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_sp_update_optimization_rules",
"arguments": {
"store": "myStore-US",
"countryCode": "<countryCode>",
"body": "<body>"
}
}From code (Tool API)
curl -X POST https://api.sellersheetai.com/api/v1/tools/ads_sp_update_optimization_rules \
-H "Authorization: Bearer $SELLERSHEET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"store":"myStore-US","countryCode":"<countryCode>","body":"<body>"}'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'). |
bodyrequired | object[] | object | the FULL rule object(s) including optimizationRuleId — v1 1–25 rules per call, v2 1–300. |
apiVersion | string | v1 (default) | v2 — must match the rule's own kind.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.
Body (Amazon schema; application/vnd.spoptimizationrules.v1+json): {optimizationRules
[OptimizationRulesAPISwaggerOptimizationRule]} (1–25), each item:
action*: {actionDetails*: {actionOperator*, actionUnit*, value*}, actionType*: ADOPT}
action.actionDetails.actionOperator: INCREMENT
action.actionDetails.actionUnit: PERCENT
conditions: [{attributeName: ROAS, criteria: {maxValue*, minValue*} | {comparisonOperator*, value*}}] (max 1)
conditions.criteria.comparisonOperator: EQUAL_TO | GREATER_THAN | GREATER_THAN_OR_EQUAL_TO | LESS_THAN | LESS_THAN_OR_EQUAL_TO
recurrence*: {daysOfWeek, duration*: {endTime, eventId, eventName, startTime}, timesOfDay: [{endTime*, startTime*}] (max 1), type*: DAILY | WEEKLY}
recurrence.daysOfWeek: [FRIDAY | MONDAY | SATURDAY | SUNDAY | THURSDAY | TUESDAY | WEDNESDAY]
ruleCategory*: BID
ruleName: string
ruleSubCategory*: SCHEDULE
status: ENABLED | ENDED | PAUSED | SCHEDULED
optimizationRuleId: stringGotchas
- To stop a rule, send status: PAUSED yourself — it is the only status Amazon honours as an off-switch. ARCHIVED and ENDED are refused before the call reaches Amazon (Amazon itself 400s ARCHIVED and silently reverts ENDED to SCHEDULED).
- A rule read back from ads_search_optimization_rules may carry a `recurrence` (on a TARGETING rule, which rejects it on write) or an empty v2 `targeting: []` (which 400s as "size must be between 1 and 1") — both are stripped automatically before the write, so a naive list -> edit -> update round trip does not fail.
- Changes take up to 24 hours to take effect; rules stack additively.