{
  "openapi": "3.1.0",
  "info": {
    "title": "推广助手 Codex 接口",
    "version": "1.1.0",
    "description": "Website-session authentication and explicit shop scope. Promotion executor identity is isolated from the listing executor. Remote network deployment is configured separately. See CODEX_CONNECT.md."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/api/promo-agent/stores": {
      "get": {
        "tags": [
          "promo-agent"
        ],
        "summary": "List Stores",
        "operationId": "list_stores_api_promo_agent_stores_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response List Stores Api Promo Agent Stores Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/executors": {
      "get": {
        "tags": ["promo-agent"],
        "summary": "List Promotion Executors",
        "operationId": "list_promo_executors_api_promo_agent_executors_get",
        "responses": {"200": {"description": "Online/offline promotion executor candidates for this store.", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true}}}}},
        "security": [{"websiteSession": []}],
        "parameters": [{"name": "X-Promo-Store", "in": "header", "required": true, "schema": {"type": "string"}, "description": "Exact store key from /stores."}],
        "x-advertising-write": false
      }
    },
    "/api/promo-agent/executors/{executor_id}/select": {
      "post": {
        "tags": ["promo-agent"],
        "summary": "Select Promotion Executor",
        "operationId": "select_promo_executor_api_promo_agent_executors_select_post",
        "parameters": [{"name": "executor_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "X-Promo-Store", "in": "header", "required": true, "schema": {"type": "string"}}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["store_key"], "properties": {"store_key": {"type": "string"}}}}}},
        "responses": {"200": {"description": "The selected executor and current route.", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true}}}}, "409": {"description": "Executor is not bound or is unavailable."}},
        "security": [{"websiteSession": []}],
        "x-advertising-write": false,
        "x-retry-policy": "Refresh /executors before selecting; do not guess an executor number."
      }
    },
    "/api/promo-agent/bootstrap": {
      "get": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Bootstrap",
        "operationId": "bootstrap_api_promo_agent_bootstrap_get",
        "parameters": [
          {
            "name": "product_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "",
              "title": "Product Id"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Bootstrap Api Promo Agent Bootstrap Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/summary": {
      "get": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Summary",
        "operationId": "summary_api_promo_agent_summary_get",
        "parameters": [
          {
            "name": "product_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "",
              "title": "Product Id"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Summary Api Promo Agent Summary Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/state": {
      "get": {
        "tags": [
          "promo-agent"
        ],
        "summary": "State",
        "operationId": "state_api_promo_agent_state_get",
        "parameters": [
          {
            "name": "product_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "",
              "title": "Product Id"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response State Api Promo Agent State Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/analysis": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Analyze",
        "operationId": "analyze_api_promo_agent_analysis_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalysisRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Analyze Api Promo Agent Analysis Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation": {
      "get": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Read",
        "operationId": "read_api_promo_agent_automation_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/settings": {
      "put": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Save",
        "operationId": "save_api_promo_agent_automation_settings_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromotionSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/playbooks": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Create Playbook",
        "operationId": "create_playbook_api_promo_agent_automation_playbooks_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaybookInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/playbooks/{playbook_id}": {
      "put": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Update Playbook",
        "operationId": "update_playbook_api_promo_agent_automation_playbooks__playbook_id__put",
        "parameters": [
          {
            "name": "playbook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Playbook Id"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaybookInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/maintenance": {
      "get": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Maintenance",
        "operationId": "maintenance_api_promo_agent_automation_maintenance_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/playbooks/{playbook_id}/versions": {
      "get": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Playbook Versions",
        "operationId": "playbook_versions_api_promo_agent_automation_playbooks__playbook_id__versions_get",
        "parameters": [
          {
            "name": "playbook_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Playbook Id"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/run": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Run",
        "operationId": "run_api_promo_agent_automation_run_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/stop": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Stop Goal",
        "operationId": "stop_goal_api_promo_agent_automation_stop_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/actions/{action_id}/verify": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Verify",
        "operationId": "verify_api_promo_agent_automation_actions__action_id__verify_post",
        "parameters": [
          {
            "name": "action_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Action Id"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/actions/{action_id}": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Command",
        "operationId": "command_api_promo_agent_automation_actions__action_id__post",
        "parameters": [
          {
            "name": "action_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Action Id"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/actions/{action_id}/dismiss": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Dismiss",
        "operationId": "dismiss_api_promo_agent_automation_actions__action_id__dismiss_post",
        "parameters": [
          {
            "name": "action_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Action Id"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/readiness": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Start",
        "operationId": "start_api_promo_agent_automation_readiness_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadinessInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/audiences/catalog": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Catalog",
        "operationId": "catalog_api_promo_agent_automation_audiences_catalog_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/audiences/drafts": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Draft",
        "operationId": "draft_api_promo_agent_automation_audiences_drafts_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudienceDraftInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/audiences/{identifier}/run": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Run",
        "operationId": "run_api_promo_agent_automation_audiences__identifier__run_post",
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Identifier"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudienceCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/audiences/{identifier}/verify": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Verify",
        "operationId": "verify_api_promo_agent_automation_audiences__identifier__verify_post",
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Identifier"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/audiences/{identifier}/dismiss": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Dismiss",
        "operationId": "dismiss_api_promo_agent_automation_audiences__identifier__dismiss_post",
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Identifier"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": true,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    },
    "/api/promo-agent/automation/chat-drafts/{draft_id}/confirm": {
      "post": {
        "tags": [
          "promo-agent"
        ],
        "summary": "Confirm",
        "operationId": "confirm_api_promo_agent_automation_chat_drafts__draft_id__confirm_post",
        "parameters": [
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Draft Id"
            }
          },
          {
            "name": "X-Promo-Store",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact store key from /stores; do not substitute its display name."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "websiteSession": []
          }
        ],
        "x-advertising-write": false,
        "x-retry-policy": "Inspect the same persisted record before retrying; uncertain outcomes are verify-only."
      }
    }
  },
  "components": {
    "schemas": {
      "ActionCommand": {
        "properties": {
          "execute": {
            "type": "boolean",
            "title": "Execute",
            "default": false
          }
        },
        "type": "object",
        "title": "ActionCommand"
      },
      "AnalysisRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "maxLength": 3000,
            "minLength": 1,
            "title": "Prompt"
          },
          "product_id": {
            "type": "string",
            "maxLength": 80,
            "title": "Product Id",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "AnalysisRequest"
      },
      "AudienceCommand": {
        "properties": {
          "execute": {
            "type": "boolean",
            "title": "Execute",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "AudienceCommand"
      },
      "AudienceDraftInput": {
        "properties": {
          "groups": {
            "items": {
              "$ref": "#/components/schemas/AudienceGroup"
            },
            "type": "array",
            "maxItems": 3,
            "minItems": 1,
            "title": "Groups"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "groups"
        ],
        "title": "AudienceDraftInput"
      },
      "AudienceGroup": {
        "properties": {
          "category": {
            "type": "string",
            "maxLength": 30,
            "minLength": 1,
            "title": "Category"
          },
          "conditions": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "maxProperties": 4,
            "minProperties": 1,
            "title": "Conditions"
          },
          "premium": {
            "type": "integer",
            "maximum": 300.0,
            "minimum": 5.0,
            "title": "Premium"
          },
          "name": {
            "type": "string",
            "maxLength": 40,
            "title": "Name",
            "default": ""
          },
          "reason": {
            "type": "string",
            "maxLength": 1000,
            "title": "Reason",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "category",
          "conditions",
          "premium"
        ],
        "title": "AudienceGroup"
      },
      "Body_import_products_file_api_promo_agent_products_import_file_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_import_products_file_api_promo_agent_products_import_file_post"
      },
      "Body_import_report_file_api_promo_agent_reports_import_file_post": {
        "properties": {
          "source_type": {
            "type": "string",
            "title": "Source Type"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "default": ""
          },
          "product_id": {
            "type": "string",
            "title": "Product Id",
            "default": ""
          },
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "source_type",
          "file"
        ],
        "title": "Body_import_report_file_api_promo_agent_reports_import_file_post"
      },
      "CollectorWindowRequest": {
        "properties": {
          "visible": {
            "type": "boolean",
            "title": "Visible"
          }
        },
        "type": "object",
        "required": [
          "visible"
        ],
        "title": "CollectorWindowRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "PlaybookInput": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 80,
            "minLength": 1,
            "title": "Name"
          },
          "applies_to": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1,
            "title": "Applies To"
          },
          "opening_method": {
            "type": "string",
            "maxLength": 3000,
            "minLength": 1,
            "title": "Opening Method"
          },
          "adjustment_rules": {
            "type": "string",
            "maxLength": 5000,
            "minLength": 1,
            "title": "Adjustment Rules"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "name",
          "applies_to",
          "opening_method",
          "adjustment_rules"
        ],
        "title": "PlaybookInput"
      },
      "ProductImportDataRequest": {
        "properties": {
          "data": {
            "title": "Data"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ProductImportDataRequest"
      },
      "ProductSegmentsRequest": {
        "properties": {
          "segments": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 3,
            "title": "Segments"
          }
        },
        "type": "object",
        "title": "ProductSegmentsRequest"
      },
      "ProductUpsertRequest": {
        "properties": {
          "item_id": {
            "type": "string",
            "maxLength": 80,
            "minLength": 1,
            "title": "Item Id"
          },
          "title": {
            "type": "string",
            "maxLength": 240,
            "minLength": 1,
            "title": "Title"
          },
          "image_url": {
            "type": "string",
            "maxLength": 1600,
            "title": "Image Url",
            "default": ""
          },
          "merchant_code": {
            "type": "string",
            "maxLength": 120,
            "title": "Merchant Code",
            "default": ""
          },
          "price": {
            "type": "string",
            "maxLength": 60,
            "title": "Price",
            "default": ""
          },
          "status": {
            "type": "string",
            "maxLength": 80,
            "title": "Status",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "item_id",
          "title"
        ],
        "title": "ProductUpsertRequest"
      },
      "PromotionSettings": {
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "off",
              "preview",
              "review",
              "auto"
            ],
            "title": "Mode",
            "default": "off"
          },
          "scope_type": {
            "type": "string",
            "enum": [
              "store",
              "product"
            ],
            "title": "Scope Type",
            "default": "store"
          },
          "product_id": {
            "type": "string",
            "pattern": "^\\d{0,32}$",
            "title": "Product Id",
            "default": ""
          },
          "playbook_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{0,80}$",
            "title": "Playbook Id",
            "default": ""
          },
          "objective": {
            "type": "string",
            "maxLength": 1000,
            "title": "Objective",
            "default": "在预算范围内提高投产比，保留必要的测试与成交规模"
          },
          "target_roi": {
            "type": "number",
            "maximum": 1000.0,
            "exclusiveMinimum": 0.0,
            "title": "Target Roi",
            "default": 3
          },
          "account_id": {
            "type": "string",
            "pattern": "^\\d{0,32}$",
            "title": "Account Id",
            "default": ""
          },
          "campaign_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 20,
            "title": "Campaign Ids"
          },
          "daily_budget_cap": {
            "type": "number",
            "maximum": 1000000.0,
            "minimum": 0.0,
            "title": "Daily Budget Cap",
            "default": 0
          },
          "max_change_pct": {
            "type": "number",
            "maximum": 20.0,
            "exclusiveMinimum": 0.0,
            "title": "Max Change Pct",
            "default": 10
          },
          "min_cost": {
            "type": "number",
            "maximum": 100000.0,
            "minimum": 1.0,
            "title": "Min Cost",
            "default": 50
          },
          "min_clicks": {
            "type": "integer",
            "maximum": 100000.0,
            "minimum": 1.0,
            "title": "Min Clicks",
            "default": 50
          },
          "max_actions": {
            "type": "integer",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "Max Actions",
            "default": 3
          },
          "interval_hours": {
            "type": "integer",
            "maximum": 168.0,
            "minimum": 6.0,
            "title": "Interval Hours",
            "default": 24
          },
          "observation_hours": {
            "type": "integer",
            "maximum": 336.0,
            "minimum": 24.0,
            "title": "Observation Hours",
            "default": 48
          },
          "attribution_days": {
            "type": "integer",
            "maximum": 30.0,
            "minimum": 1.0,
            "title": "Attribution Days",
            "default": 15
          },
          "allow_increase": {
            "type": "boolean",
            "title": "Allow Increase",
            "default": false
          },
          "allowed_actions": {
            "items": {
              "type": "string",
              "enum": [
                "campaign_budget",
                "keyword_bid",
                "audience_premium"
              ]
            },
            "type": "array",
            "title": "Allowed Actions"
          }
        },
        "type": "object",
        "title": "PromotionSettings"
      },
      "ReadinessInput": {
        "properties": {
          "account_id": {
            "type": "string",
            "pattern": "^\\d{1,32}$",
            "title": "Account Id"
          },
          "campaign_id": {
            "type": "string",
            "pattern": "^\\d{1,32}$",
            "title": "Campaign Id"
          },
          "adgroup_id": {
            "type": "string",
            "pattern": "^\\d{0,32}$",
            "title": "Adgroup Id",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "account_id",
          "campaign_id"
        ],
        "title": "ReadinessInput"
      },
      "ReportImportRequest": {
        "properties": {
          "source_type": {
            "type": "string",
            "maxLength": 60,
            "minLength": 1,
            "title": "Source Type"
          },
          "title": {
            "type": "string",
            "maxLength": 160,
            "minLength": 1,
            "title": "Title"
          },
          "product_id": {
            "type": "string",
            "maxLength": 80,
            "title": "Product Id",
            "default": ""
          },
          "data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Data"
          }
        },
        "type": "object",
        "required": [
          "source_type",
          "title"
        ],
        "title": "ReportImportRequest"
      },
      "StoreCreateRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 80,
            "minLength": 1,
            "title": "Name"
          },
          "key": {
            "type": "string",
            "maxLength": 64,
            "title": "Key",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "StoreCreateRequest"
      },
      "TaskCreateRequest": {
        "properties": {
          "kind": {
            "type": "string",
            "maxLength": 80,
            "minLength": 1,
            "title": "Kind"
          },
          "product_id": {
            "type": "string",
            "maxLength": 80,
            "title": "Product Id",
            "default": ""
          },
          "title": {
            "type": "string",
            "maxLength": 180,
            "title": "Title",
            "default": ""
          },
          "detail": {
            "type": "string",
            "maxLength": 1000,
            "title": "Detail",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "kind"
        ],
        "title": "TaskCreateRequest"
      },
      "TrialInput": {
        "properties": {
          "entity_id": {
            "type": "string",
            "pattern": "^\\d{1,32}$",
            "title": "Entity Id"
          },
          "before": {
            "type": "number",
            "maximum": 99.99,
            "exclusiveMinimum": 0.0,
            "title": "Before"
          },
          "after": {
            "type": "number",
            "maximum": 99.99,
            "minimum": 0.05,
            "title": "After"
          },
          "confirm_round_trip": {
            "type": "boolean",
            "const": true,
            "title": "Confirm Round Trip"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "entity_id",
          "before",
          "after",
          "confirm_round_trip"
        ],
        "title": "TrialInput"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "websiteSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "detail_session",
        "description": "Normal website sign-in. Do not extract cookies from disk or copy Taobao credentials."
      }
    }
  }
}
