{
  "openapi": "3.1.0",
  "info": {
    "title": "SAMLab update",
    "version": "0.4.0",
    "description": "ICAMA 实时查询与 UPLS 只读预览查询，使用不同的 Bearer Token。UPLS 默认待连接，业务返回 UNAVAILABLE。ICAMA 异步任务完成后内存保留 600 秒。调用方按可信代理解析后的出口 IP 区分。同步请求 5 秒队列等待 + 20 秒执行；批量 60 秒队列等待 + 240 秒执行。A1 来源侧可选持久化本地快照和冻结候选，独立只读凭据；默认清单为空、定时关闭。"
  },
  "servers": [
    {
      "url": "https://mcp.samlab.cn"
    }
  ],
  "paths": {
    "/api/update": {
      "get": {
        "summary": "updateRegistration",
        "operationId": "updateRegistration",
        "parameters": [
          {
            "name": "X-Request-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "本次调用方范围内的幂等请求 ID"
          },
          {
            "name": "X-Trace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "当前调用的独立追踪 ID"
          },
          {
            "name": "X-Priority",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "normal"
              ]
            }
          },
          {
            "name": "registrationNumber",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "已处理；查询结果须继续检查 data.status",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/QueryResult"
                    },
                    "requestId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                      "maxLength": 128
                    },
                    "traceId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                      "maxLength": 128
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "requestId",
                    "traceId",
                    "timestamp",
                    "replayed"
                  ]
                }
              }
            }
          },
          "405": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "update"
        ],
        "security": [
          {
            "LiveToken": []
          }
        ]
      }
    },
    "/api/update/search": {
      "get": {
        "summary": "searchPesticides",
        "operationId": "updateSearchPesticides",
        "parameters": [
          {
            "name": "X-Request-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "本次调用方范围内的幂等请求 ID"
          },
          {
            "name": "X-Trace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "当前调用的独立追踪 ID"
          },
          {
            "name": "X-Priority",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "normal"
              ]
            }
          },
          {
            "name": "productName",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 50
            }
          },
          {
            "name": "registrationHolder",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "已处理；查询结果须继续检查 data.status",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/QueryResult"
                    },
                    "requestId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                      "maxLength": 128
                    },
                    "traceId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                      "maxLength": 128
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "requestId",
                    "traceId",
                    "timestamp",
                    "replayed"
                  ]
                }
              }
            }
          },
          "405": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "update"
        ],
        "security": [
          {
            "LiveToken": []
          }
        ]
      }
    },
    "/api/update/batch": {
      "post": {
        "summary": "submitPesticideBatch",
        "operationId": "updateSubmitPesticideBatch",
        "parameters": [
          {
            "name": "X-Request-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "本次调用方范围内的幂等请求 ID"
          },
          {
            "name": "X-Trace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "当前调用的独立追踪 ID"
          },
          {
            "name": "X-Priority",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "normal"
              ]
            }
          }
        ],
        "responses": {
          "202": {
            "description": "任务已接受，尚未完成",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/BatchAccepted"
                    },
                    "requestId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                      "maxLength": 128
                    },
                    "traceId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                      "maxLength": 128
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "requestId",
                    "traceId",
                    "timestamp",
                    "replayed"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "405": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "update"
        ],
        "security": [
          {
            "LiveToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "registrationNumbers": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "type": "string"
                    }
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "normal"
                    ]
                  }
                },
                "required": [
                  "registrationNumbers"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/update/jobs/{jobId}": {
      "get": {
        "summary": "getLiveJob",
        "operationId": "updateGetLiveJob",
        "parameters": [
          {
            "name": "X-Request-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "本次调用方范围内的幂等请求 ID"
          },
          {
            "name": "X-Trace-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
              "maxLength": 128
            },
            "description": "当前调用的独立追踪 ID"
          },
          {
            "name": "X-Priority",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "normal"
              ]
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "已处理；查询结果须继续检查 data.status",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/LiveJob"
                    },
                    "requestId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                      "maxLength": 128
                    },
                    "traceId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                      "maxLength": 128
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "requestId",
                    "traceId",
                    "timestamp",
                    "replayed"
                  ]
                }
              }
            }
          },
          "405": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "服务层错误，查看 error.code；429/503 按 Retry-After 退避",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "本次调用方范围内的幂等请求 ID"
              },
              "X-Trace-ID": {
                "schema": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
                  "maxLength": 128
                },
                "description": "当前调用的独立追踪 ID"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "update"
        ],
        "security": [
          {
            "LiveToken": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Ingredient": {
        "type": "object",
        "properties": {
          "ingredient_name": {
            "type": "string"
          },
          "ingredient_english_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ingredient_content": {
            "type": "string"
          }
        },
        "required": [
          "ingredient_name",
          "ingredient_content"
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "crop_or_place": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "dosage": {
            "type": "string"
          },
          "dosage_header": {
            "type": "string"
          },
          "application_method": {
            "type": "string"
          }
        },
        "required": [
          "crop_or_place",
          "target",
          "dosage",
          "dosage_header",
          "application_method"
        ]
      },
      "Registration": {
        "type": "object",
        "properties": {
          "registration_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "registration_holder": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "formulation": {
            "type": [
              "string",
              "null"
            ]
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_approval_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "registration_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "toxicity": {
            "type": [
              "string",
              "null"
            ]
          },
          "total_active_content": {
            "type": [
              "string",
              "null"
            ]
          },
          "remarks": {
            "type": [
              "string",
              "null"
            ]
          },
          "ingredients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ingredient"
            }
          },
          "usages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Usage"
            }
          },
          "sections": {
            "type": "object",
            "properties": {
              "ingredients": {
                "type": "string",
                "enum": [
                  "present",
                  "empty",
                  "not_provided"
                ]
              },
              "usages": {
                "type": "string",
                "enum": [
                  "present",
                  "empty",
                  "not_provided"
                ]
              }
            },
            "required": []
          }
        },
        "required": [
          "registration_number",
          "product_name",
          "ingredients",
          "usages",
          "sections"
        ]
      },
      "ListItem": {
        "type": "object",
        "properties": {
          "registration_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "registration_holder": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "formulation": {
            "type": [
              "string",
              "null"
            ]
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_approval_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "registration_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "toxicity": {
            "type": [
              "string",
              "null"
            ]
          },
          "total_active_content": {
            "type": [
              "string",
              "null"
            ]
          },
          "remarks": {
            "type": [
              "string",
              "null"
            ]
          },
          "detail_url": {
            "type": "string"
          }
        },
        "required": [
          "registration_number",
          "product_name",
          "detail_url"
        ]
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "minimum": 0
          },
          "totalItems": {
            "type": [
              "integer",
              "null"
            ]
          },
          "totalPages": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "page",
          "pageSize",
          "totalItems",
          "totalPages"
        ]
      },
      "QueryResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "not_found",
              "source_unavailable",
              "busy"
            ]
          },
          "dataset": {
            "const": "pesticide_registration"
          },
          "publisher": {
            "type": "string"
          },
          "source_url": {
            "type": "string"
          },
          "queried_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Registration"
              },
              {
                "type": "null"
              }
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListItem"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          },
          "queue_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2
          },
          "registration_number": {
            "type": "string"
          },
          "queue_wait_ms": {
            "type": "integer",
            "minimum": 0
          },
          "elapsed_ms": {
            "type": "integer",
            "minimum": 0
          },
          "retry_after": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "status",
          "dataset",
          "publisher",
          "source_url",
          "queried_at",
          "data",
          "message"
        ]
      },
      "BatchAccepted": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "const": "queued"
          },
          "queue_id": {
            "type": "integer",
            "minimum": 0
          },
          "poll_url": {
            "type": "string"
          },
          "retry_after": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "job_id",
          "status",
          "queue_id",
          "poll_url",
          "retry_after"
        ]
      },
      "LiveJob": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed",
              "failed"
            ]
          },
          "queue_id": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "progress": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "completed": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "total",
              "completed"
            ]
          },
          "results": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/QueryResult"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "ok": {
                "type": "integer",
                "minimum": 0
              },
              "not_found": {
                "type": "integer",
                "minimum": 0
              },
              "source_unavailable": {
                "type": "integer",
                "minimum": 0
              },
              "busy": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": []
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": []
              },
              {
                "type": "null"
              }
            ]
          },
          "retention_seconds": {
            "type": "number"
          }
        },
        "required": [
          "job_id",
          "status",
          "queue_id",
          "progress",
          "results",
          "summary"
        ]
      },
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "const": false
          },
          "requestId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "maxLength": 128
          },
          "traceId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
            "maxLength": 128
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "INVALID_PARAMETER",
                  "CONFLICT",
                  "NOT_FOUND",
                  "RATE_LIMITED",
                  "SERVICE_UNAVAILABLE",
                  "INVALID_CREDENTIALS",
                  "UNSUPPORTED_MEDIA_TYPE",
                  "PAYLOAD_TOO_LARGE",
                  "INTERNAL_ERROR",
                  "CURSOR_EXPIRED"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": [
                  "object",
                  "null"
                ]
              }
            },
            "required": [
              "code",
              "message",
              "details"
            ]
          }
        },
        "required": [
          "success",
          "requestId",
          "traceId",
          "timestamp",
          "error"
        ]
      }
    },
    "securitySchemes": {
      "LiveToken": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
