{
  "tags": [
    "身份认证"
  ],
  "description": "通过已启用账号的邮箱验证码或手机验证码重置密码。该公共接口不要求登录。邮箱方式会在更新密码前向该邮箱发送包含新密码的重置成功邮件；邮件发送失败时本次重置会回滚。",
  "operationId": "public_post_v1_reset_pass",
  "security": [],
  "responses": {
    "200": {
      "description": "重置成功时 `data` 为 null；参数、账号、验证码、密码强度和邮件发送失败均通过 HTTP 200 的业务错误响应返回。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "成功状态码，固定为 0。"
                  },
                  "msg": {
                    "type": "string",
                    "enum": [
                      "重置成功!"
                    ],
                    "description": "重置成功提示。"
                  },
                  "data": {
                    "type": "string",
                    "nullable": true,
                    "description": "成功时为 null。"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "reset_pass-1",
                      "reset_pass-2",
                      "reset_pass-3",
                      "reset_pass-4",
                      "reset_pass-5",
                      "reset_pass-6",
                      "reset_pass-7",
                      "reset_pass-8",
                      "reset_pass-9",
                      "reset_pass-10",
                      "reset_pass-11",
                      "reset_pass-12",
                      "reset_pass-13",
                      "reset_pass-14",
                      "reset_pass-15",
                      "reset_pass-16",
                      "reset_pass-17",
                      "reset_pass-18",
                      "reset_pass-19",
                      "reset_pass-20",
                      "reset_pass-21",
                      "reset_pass-22"
                    ],
                    "description": "重置方式、邮箱/手机号、验证码、密码强度或邮件发送失败对应的业务错误码。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "具体错误原因，例如验证码错误、账号不存在或密码不符合强度要求。"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时固定为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "examples": {
            "success": {
              "summary": "重置成功",
              "value": {
                "code": 0,
                "msg": "重置成功!",
                "data": null
              }
            },
            "invalidCaptcha": {
              "summary": "邮箱验证码无效",
              "value": {
                "code": "reset_pass-7",
                "msg": "验证码错误",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "重置成功!",
            "data": null
          }
        }
      }
    }
  },
  "x-python-handler": "user.ResetPass",
  "x-python-route-line": 153,
  "x-audience": "user",
  "x-auth": "public",
  "x-reviewed": true,
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "oneOf": [
            {
              "type": "object",
              "required": [
                "reset_by",
                "email",
                "captcha",
                "password"
              ],
              "properties": {
                "reset_by": {
                  "type": "string",
                  "enum": [
                    "email"
                  ],
                  "description": "使用邮箱验证码重置密码。"
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "description": "已启用用户的邮箱地址；必须存在。"
                },
                "captcha": {
                  "type": "string",
                  "description": "发送到该邮箱的验证码；由服务端校验有效性和时效。"
                },
                "password": {
                  "type": "string",
                  "format": "password",
                  "minLength": 6,
                  "description": "新密码，至少 6 位，且必须同时包含英文字母和数字。"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "reset_by",
                "phone",
                "phone_captcha",
                "password"
              ],
              "properties": {
                "reset_by": {
                  "type": "string",
                  "enum": [
                    "phone"
                  ],
                  "description": "使用手机验证码重置密码。"
                },
                "phone": {
                  "type": "string",
                  "description": "已启用用户的手机号码；必须符合服务端手机号格式且已存在。"
                },
                "phone_captcha": {
                  "type": "string",
                  "description": "发送到该手机号的验证码；由服务端校验有效性和时效。"
                },
                "password": {
                  "type": "string",
                  "format": "password",
                  "minLength": 6,
                  "description": "新密码，至少 6 位，且必须同时包含英文字母和数字。"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "examples": {
          "email": {
            "summary": "通过邮箱重置",
            "value": {
              "reset_by": "email",
              "email": "user@example.invalid",
              "captcha": "123456",
              "password": "REDACTED_PASSWORD_123"
            }
          },
          "phone": {
            "summary": "通过手机重置",
            "value": {
              "reset_by": "phone",
              "phone": "13800138000",
              "phone_captcha": "1234",
              "password": "REDACTED_PASSWORD_123"
            }
          }
        }
      }
    }
  },
  "parameters": [],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "user.ResetPass"
    },
    {
      "key": "x-python-route-line",
      "value": 153
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "public"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "post",
  "path": "/v1/reset-pass",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "jsonRequestBodyExample": {
    "reset_by": "email",
    "email": "user@example.com",
    "captcha": "string",
    "password": "string"
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "重置密码",
    "description": {
      "content": "通过已启用账号的邮箱验证码或手机验证码重置密码。该公共接口不要求登录。邮箱方式会在更新密码前向该邮箱发送包含新密码的重置成功邮件；邮件发送失败时本次重置会回滚。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "reset-pass"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": []
    },
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "POST",
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    }
  }
}