{"openapi": "3.0.3", "info": {"title": "FYUI Outlook Verification Code API", "version": "1.0.0", "description": "通过 OAuth2、Microsoft Graph 或混合模式读取 Outlook/Hotmail 邮件验证码。"}, "servers": [{"url": "https://outlook.fyui.top", "description": "Production"}], "tags": [{"name": "System", "description": "服务状态"}, {"name": "Mail", "description": "单账号与批量邮件取码"}], "paths": {"/api/health": {"get": {"tags": ["System"], "summary": "健康检查", "operationId": "healthCheck", "responses": {"200": {"description": "服务正常", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HealthResponse"}}}}}}}, "/api/v1/fetch": {"post": {"tags": ["Mail"], "summary": "单账号读取验证码", "operationId": "fetchSingleAccount", "security": [{"ApiKeyAuth": []}, {"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SingleRequest"}}}}, "responses": {"200": {"description": "业务处理完成", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SingleResponse"}}}}, "401": {"description": "API Key 无效"}, "429": {"description": "请求频率超限"}}}}, "/api/v1/batch": {"post": {"tags": ["Mail"], "summary": "批量读取验证码", "operationId": "fetchBatchAccounts", "security": [{"ApiKeyAuth": []}, {"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BatchRequest"}}}}, "responses": {"200": {"description": "批量业务处理完成", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BatchResponse"}}}}, "400": {"description": "请求格式错误或超过 20 个账号"}, "401": {"description": "API Key 无效"}, "429": {"description": "请求频率超限"}}}}}, "components": {"securitySchemes": {"ApiKeyAuth": {"type": "apiKey", "in": "header", "name": "X-API-Key"}, "BearerAuth": {"type": "http", "scheme": "bearer"}}, "schemas": {"HealthResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "example": true}, "service": {"type": "string", "example": "fyui-outlook-mail-ui"}}}, "AccountInput": {"type": "object", "properties": {"id": {"type": "string", "description": "客户侧请求标识，响应会原样返回。"}, "credential": {"type": "string", "description": "卡密格式：email----password----client_id----refresh_token。"}, "email": {"type": "string", "format": "email"}, "clientId": {"type": "string"}, "refreshToken": {"type": "string", "format": "password"}, "mode": {"type": "string", "enum": ["mixed", "oauth2", "graph"], "default": "mixed"}, "mailbox": {"type": "string", "enum": ["both", "INBOX", "Junk"], "default": "both"}, "endpoint": {"type": "string", "enum": ["mail-new", "mail-all"], "default": "mail-new"}, "top": {"type": "integer", "minimum": 1, "maximum": 25, "default": 10}, "timeout": {"type": "integer", "minimum": 5, "maximum": 30, "default": 25}, "includeBody": {"type": "boolean", "default": false}, "tenant": {"type": "string", "default": "consumers"}}, "description": "credential 与 email/clientId/refreshToken 两种输入方式任选其一。"}, "SingleRequest": {"allOf": [{"$ref": "#/components/schemas/AccountInput"}, {"type": "object", "properties": {"returnMessages": {"type": "boolean", "default": false}, "returnRefreshToken": {"type": "boolean", "default": true}}}]}, "BatchRequest": {"type": "object", "required": ["accounts"], "properties": {"accounts": {"type": "array", "minItems": 1, "maxItems": 20, "items": {"$ref": "#/components/schemas/AccountInput"}}, "mode": {"type": "string", "enum": ["mixed", "oauth2", "graph"]}, "mailbox": {"type": "string", "enum": ["both", "INBOX", "Junk"]}, "top": {"type": "integer", "minimum": 1, "maximum": 25}, "includeBody": {"type": "boolean"}, "returnMessages": {"type": "boolean", "default": false}, "returnRefreshToken": {"type": "boolean", "default": true}}}, "AccountResult": {"type": "object", "properties": {"id": {"type": "string"}, "ok": {"type": "boolean"}, "mode_used": {"type": "string", "nullable": true}, "account": {"type": "string"}, "codes": {"type": "array", "items": {"type": "object"}}, "code_count": {"type": "integer"}, "fetches": {"type": "array", "items": {"type": "object"}}, "error_type": {"type": "string"}, "error": {"type": "string"}, "relogin_required": {"type": "boolean"}, "new_refresh_token": {"type": "string"}}}, "SingleResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "request_id": {"type": "string"}, "result": {"$ref": "#/components/schemas/AccountResult"}}}, "BatchResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "request_id": {"type": "string"}, "count": {"type": "integer"}, "succeeded": {"type": "integer"}, "failed": {"type": "integer"}, "results": {"type": "array", "items": {"$ref": "#/components/schemas/AccountResult"}}}}}}}