{
  "openapi": "3.1.0",
  "info": {
    "title": "火花 App 独立公共运行 API",
    "version": "0.6.6",
    "description": "local与central共用。App后端持有HUOHUA_APP_TOKEN；前端不能直接访问。默认由公共服务验证登录名密码、生成ID及管理会话；App后端代理并负责真实业务。"
  },
  "servers": [
    {
      "url": "{serviceUrl}",
      "variables": {
        "serviceUrl": {
          "default": "http://127.0.0.1:8098",
          "description": "HUOHUA_APP_SERVICE_URL；central必须使用内网HTTPS"
        }
      }
    }
  ],
  "security": [
    {
      "AppRuntimeToken": []
    }
  ],
  "paths": {
    "/v1/apps/{appId}/auth/register": {
      "post": {
        "operationId": "registerAppAccount",
        "description": "登录名密码注册，生成统一公式用户ID并返回会话",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/auth/login": {
      "post": {
        "operationId": "loginAppAccount",
        "description": "按已启用loginMethod验证账号密码或小游戏换码；账号platform仍为app",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Credential"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/identities/list": {
      "post": {
        "operationId": "identitylist",
        "description": "有效会话管理三种登录身份；绑定和解绑后重新登录",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionToken"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/identities/bind": {
      "post": {
        "operationId": "identitybind",
        "description": "有效会话管理三种登录身份；绑定和解绑后重新登录",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BindIdentity"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/identities/unbind": {
      "post": {
        "operationId": "identityunbind",
        "description": "有效会话管理三种登录身份；绑定和解绑后重新登录",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnbindIdentity"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/auth/deactivate-with-proof": {
      "post": {
        "operationId": "deactivateWithProof",
        "description": "有效会话及新鲜认证证明注销账号，三种方式复用同一账号状态",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeactivateProof"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/auth/change-password": {
      "post": {
        "operationId": "changeAppPassword",
        "description": "验证会话和旧密码，撤销全部旧会话，需重新登录",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChange"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/capabilities": {
      "get": {
        "operationId": "appCapabilities",
        "description": "读取版本、模式和功能；ads/cloudSync为false",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/sessions/validate": {
      "post": {
        "operationId": "validateAppSession",
        "description": "校验本App会话；过期/退出401",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionToken"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/sessions/logout": {
      "post": {
        "operationId": "logoutAppSession",
        "description": "使会话失效；重复退出幂等",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionToken"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/promotion-claims": {
      "post": {
        "operationId": "reserveAppPromotion",
        "description": "记录首次有效推广码并预留权益；同用户不改绑，首次时间不因重试改变",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Claim"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/promotion-claims/{claimId}": {
      "get": {
        "operationId": "getAppClaim",
        "description": "查询领取状态与首次有效时间",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          },
          {
            "name": "claimId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Claim"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/promotion-claims/{claimId}/confirm": {
      "post": {
        "operationId": "confirmAppClaim",
        "description": "App数据库按claimId幂等发权益后确认；无附带权益时也需确认",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          },
          {
            "name": "claimId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Claim"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/events": {
      "post": {
        "operationId": "submitAppEvent",
        "description": "提交可信业务数据，服务自动关联已确认推广码。持久入队，不等于奖励到账",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/events/{eventId}": {
      "get": {
        "operationId": "getAppEvent",
        "description": "读取发送状态和平台结果",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/events/{eventId}/retry": {
      "post": {
        "operationId": "retryAppEvent",
        "description": "仅失败事件可重试，保持原ID与内容",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/sync-status": {
      "get": {
        "operationId": "getAppSyncStatus",
        "description": "读取本App业务事件与advertisements广告快照的积压和送达统计",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功；重复修改请求读取原业务结果，不等于新发放权益",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "413",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "415",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/apps/{appId}/auth/revoke-all-sessions": {
      "post": {
        "operationId": "postauthrevokeallsessions",
        "description": "撤销本人全部会话，含当前会话；同操作可重试",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelfRevoke"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/auth/deactivate": {
      "post": {
        "operationId": "postauthdeactivate",
        "description": "验证当前会话和密码后注销；移除密码哈希，保留最小墓碑防自动复活",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelfDeactivate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/management/users/{userId}": {
      "get": {
        "operationId": "getmanagementusersuserId",
        "description": "读取账号状态",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppManagementToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountStatus"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/management/users/{userId}/disable": {
      "post": {
        "operationId": "postmanagementusersuserIddisable",
        "description": "受控管理操作；不能恢复deleted账号，恢复disabled不会复活旧会话",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppManagementToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountStatus"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/management/users/{userId}/enable": {
      "post": {
        "operationId": "postmanagementusersuserIdenable",
        "description": "受控管理操作；不能恢复deleted账号，恢复disabled不会复活旧会话",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppManagementToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountStatus"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/management/users/{userId}/delete": {
      "post": {
        "operationId": "postmanagementusersuserIddelete",
        "description": "受控管理操作；不能恢复deleted账号，恢复disabled不会复活旧会话",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppManagementToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountStatus"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/management/users/{userId}/revoke": {
      "post": {
        "operationId": "postmanagementusersuserIdrevoke",
        "description": "受控管理操作；不能恢复deleted账号，恢复disabled不会复活旧会话",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppManagementToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountStatus"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/management/entitlements/grant": {
      "post": {
        "operationId": "postmanagemententitlementsgrant",
        "description": "按受控配置的奖励场景直接入账，不接受任意数量；返回manual:前缀操作ID",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppManagementToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FieldGrant"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementOperation"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/users/{userId}/entitlements": {
      "get": {
        "operationId": "getusersuserIdentitlements",
        "description": "读取余额、占用与可用余额",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/users/{userId}/entitlements/operations": {
      "get": {
        "operationId": "getusersuserIdentitlementsoperations",
        "description": "分页读取该用户权益流水；最多100条",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "description": "上一页最后的operationId，每页最多100项，按ID排序"
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/entitlements/reservations": {
      "post": {
        "operationId": "postentitlementsreservations",
        "description": "预留扣减额度，返回consume:前缀操作ID；App业务事务完成后确认，失败取消",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FieldReserve"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementOperation"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/entitlements/operations/{operationId}": {
      "get": {
        "operationId": "getentitlementsoperationsoperationId",
        "description": "查询原操作，使用响应返回的完整操作ID",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementOperation"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/entitlements/operations/{operationId}/confirm": {
      "post": {
        "operationId": "postentitlementsoperationsoperationIdconfirm",
        "description": "收敛已预留消费；允许禁用/注销后的既有操作恢复，不能创建新消费",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementOperation"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/entitlements/operations/{operationId}/cancel": {
      "post": {
        "operationId": "postentitlementsoperationsoperationIdcancel",
        "description": "收敛已预留消费；允许禁用/注销后的既有操作恢复，不能创建新消费",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementOperation"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/ads/contexts": {
      "post": {
        "operationId": "postadscontexts",
        "description": "创建30分钟广告上下文；激励必须有用户，开屏可匿名；类型与奖励从配置读取",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdContext"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/ads/contexts/{contextId}/complete": {
      "post": {
        "operationId": "postadscontextscontextIdcomplete",
        "description": "App后端接SDK完成通知，以已认证用户及上下文提交；交易号拿到时可附带，未拿到不阻塞先发奖；先按配置发奖，验真状态独立，重复不加奖",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "contextId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdComplete"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdContext"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/ads/contexts/{contextId}/report-status": {
      "get": {
        "operationId": "getadscontextscontextIdreportstatus",
        "description": "查询最新广告快照版本、投递状态、重试次数和错误码；delivered表示火花接收回执已核对",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "contextId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/ads/contexts/{contextId}": {
      "get": {
        "operationId": "getadscontextscontextId",
        "description": "查询展示或已发奖状态",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "contextId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdContext"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/ads/contexts/{contextId}/display": {
      "post": {
        "operationId": "postadscontextscontextIddisplay",
        "description": "展示留痕不证明已验真，不发奖励",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "contextId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppRuntimeToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdContext"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    },
    "/v1/apps/{appId}/ads/callbacks/{placement}": {
      "post": {
        "operationId": "postadscallbacksplacement",
        "description": "穿山甲直连原始回调适配，异步验签仅更新verification并上报火花，不新增或追回奖励；要求受控管理凭据和入口来源校验，返回isValid与context",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "placement",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "security": [
          {
            "AppManagementToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdCallback"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；以operationId及状态查询恢复，重试不重复变更",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "400"
          },
          "401": {
            "description": "401"
          },
          "403": {
            "description": "账号已禁用或注销"
          },
          "404": {
            "description": "404"
          },
          "409": {
            "description": "409"
          },
          "429": {
            "description": "429"
          },
          "503": {
            "description": "503"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppRuntimeToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "每App独立运行凭据，不是APP_PORTAL_TOKEN"
      },
      "AppManagementToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "每App独立managementTokenEnv，仅管理和受控广告回调入口使用；不能调用普通运行接口"
      }
    },
    "schemas": {
      "User": {
        "type": "object",
        "properties": {
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "appId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "platform": {
            "const": "app"
          },
          "loginName": {
            "type": "string",
            "pattern": "^[a-z0-9_]{4,32}$"
          }
        },
        "required": [
          "appUserId",
          "appId",
          "platform"
        ],
        "additionalProperties": false
      },
      "Login": {
        "type": "object",
        "properties": {
          "loginMethod": {
            "const": "password"
          },
          "loginName": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_]{4,32}$"
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "UTF-8字节数8至128，不裁剪内容",
            "x-minBytes": 8,
            "x-maxBytes": 128
          }
        },
        "required": [
          "loginName",
          "password"
        ],
        "additionalProperties": false
      },
      "PasswordChange": {
        "type": "object",
        "properties": {
          "sessionToken": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          },
          "oldPassword": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "UTF-8字节数8至128，不裁剪内容",
            "x-minBytes": 8,
            "x-maxBytes": 128
          },
          "newPassword": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "UTF-8字节数8至128，不裁剪内容",
            "x-minBytes": 8,
            "x-maxBytes": 128
          }
        },
        "required": [
          "sessionToken",
          "oldPassword",
          "newPassword"
        ],
        "additionalProperties": false
      },
      "UserRequest": {
        "type": "object",
        "properties": {
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "appUserId"
        ],
        "additionalProperties": false
      },
      "SessionToken": {
        "type": "object",
        "properties": {
          "sessionToken": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          }
        },
        "required": [
          "sessionToken"
        ],
        "additionalProperties": false
      },
      "Session": {
        "type": "object",
        "properties": {
          "loginMethod": {
            "enum": [
              "password",
              "wechat",
              "taptap"
            ]
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "sessionToken": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "user",
          "loginMethod",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "ClaimCreate": {
        "type": "object",
        "properties": {
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9:_-]{1,128}$"
          }
        },
        "required": [
          "appUserId",
          "code",
          "idempotencyKey"
        ],
        "additionalProperties": false
      },
      "Claim": {
        "type": "object",
        "properties": {
          "claimId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "status": {
            "enum": [
              "reserved",
              "confirmed"
            ]
          },
          "firstValidAt": {
            "type": "string",
            "format": "date-time"
          },
          "confirmedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "claimId",
          "appUserId",
          "code",
          "status",
          "firstValidAt"
        ],
        "additionalProperties": false
      },
      "Event": {
        "type": "object",
        "properties": {
          "appId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "省略时由认证身份补全；提供时必须匹配"
          },
          "eventId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9:_-]{1,128}$"
          },
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "schemaVersion": {
            "const": 1
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "minProperties": 1,
            "maxProperties": 64,
            "additionalProperties": {
              "type": [
                "number",
                "string",
                "boolean"
              ]
            }
          },
          "fieldLabels": {
            "type": "object",
            "maxProperties": 64,
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        },
        "required": [
          "eventId",
          "appUserId",
          "schemaVersion",
          "occurredAt",
          "data",
          "fieldLabels"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "additionalProperties": false
      },
      "Credential": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "loginMethod": {
                "const": "password"
              },
              "loginName": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_]{4,32}$"
              },
              "password": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "description": "UTF-8字节数8至128，不裁剪内容",
                "x-minBytes": 8,
                "x-maxBytes": 128
              }
            },
            "required": [
              "loginMethod",
              "loginName",
              "password"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "loginMethod": {
                "enum": [
                  "wechat",
                  "taptap"
                ]
              },
              "code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "loginMethod",
              "code"
            ],
            "additionalProperties": false
          }
        ]
      },
      "BindIdentity": {
        "type": "object",
        "properties": {
          "sessionToken": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          },
          "credential": {
            "$ref": "#/components/schemas/Credential"
          }
        },
        "required": [
          "sessionToken",
          "credential"
        ],
        "additionalProperties": false
      },
      "UnbindIdentity": {
        "type": "object",
        "properties": {
          "sessionToken": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          },
          "loginMethod": {
            "enum": [
              "password",
              "wechat",
              "taptap"
            ]
          },
          "proof": {
            "$ref": "#/components/schemas/Credential"
          }
        },
        "required": [
          "sessionToken",
          "loginMethod",
          "proof"
        ],
        "additionalProperties": false
      },
      "DeactivateProof": {
        "type": "object",
        "properties": {
          "sessionToken": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          },
          "operationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "credential": {
            "$ref": "#/components/schemas/Credential"
          }
        },
        "required": [
          "sessionToken",
          "operationId",
          "credential"
        ],
        "additionalProperties": false
      },
      "SelfRevoke": {
        "type": "object",
        "properties": {
          "sessionToken": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          },
          "operationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9:_-]{1,120}$"
          }
        },
        "required": [
          "sessionToken",
          "operationId"
        ],
        "additionalProperties": false
      },
      "SelfDeactivate": {
        "type": "object",
        "properties": {
          "sessionToken": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          },
          "password": {
            "type": "string",
            "description": "8至128个UTF-8字节"
          },
          "operationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9:_-]{1,120}$"
          }
        },
        "required": [
          "sessionToken",
          "password",
          "operationId"
        ],
        "additionalProperties": false
      },
      "AccountAction": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9:_-]{1,120}$"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "operationId",
          "reason"
        ],
        "additionalProperties": false
      },
      "AccountStatus": {
        "type": "object",
        "properties": {
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "state": {
            "enum": [
              "active",
              "disabled",
              "deleted"
            ]
          },
          "sessionEpoch": {
            "type": "integer"
          }
        },
        "required": [
          "appUserId",
          "state",
          "sessionEpoch"
        ],
        "additionalProperties": false
      },
      "FieldGrant": {
        "type": "object",
        "properties": {
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "scene": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "operationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9:_-]{1,120}$"
          }
        },
        "required": [
          "appUserId",
          "scene",
          "operationId"
        ],
        "additionalProperties": false
      },
      "FieldReserve": {
        "type": "object",
        "properties": {
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "field": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "amount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000000000
          },
          "operationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9:_-]{1,120}$"
          }
        },
        "required": [
          "appUserId",
          "field",
          "amount",
          "operationId"
        ],
        "additionalProperties": false
      },
      "EntitlementOperation": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "field": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "amount": {
            "type": "integer"
          },
          "kind": {
            "enum": [
              "grant",
              "consume"
            ]
          },
          "state": {
            "enum": [
              "confirmed",
              "reserved",
              "cancelled"
            ]
          }
        },
        "required": [
          "operationId",
          "appUserId",
          "field",
          "amount",
          "kind",
          "state"
        ],
        "additionalProperties": false
      },
      "AdCreate": {
        "type": "object",
        "properties": {
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "placement": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9:_-]{1,120}$"
          }
        },
        "required": [
          "placement",
          "idempotencyKey"
        ],
        "additionalProperties": false
      },
      "AdContext": {
        "type": "object",
        "properties": {
          "contextId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "placement": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "state": {
            "enum": [
              "created",
              "displayed",
              "rewarded"
            ]
          },
          "verification": {
            "enum": [
              "pending",
              "valid",
              "invalid",
              "timeout"
            ]
          },
          "rewarded": {
            "type": "boolean"
          },
          "expiresAt": {
            "type": "integer",
            "description": "UTC Unix毫秒"
          }
        },
        "required": [
          "contextId",
          "placement",
          "state",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "AdComplete": {
        "type": "object",
        "properties": {
          "appUserId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "transactionId": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "appUserId"
        ],
        "additionalProperties": false
      },
      "AdCallback": {
        "type": "object",
        "properties": {
          "rawQuery": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "description": "经过来源认证的广告公网入口转发原始RawQuery，禁止前端提交"
          }
        },
        "required": [
          "rawQuery"
        ],
        "additionalProperties": false
      }
    }
  }
}
