{
  "openapi": "3.1.0",
  "info": {
    "title": "After-Hours Agents API",
    "version": "0.9.0",
    "description": "シフト制で働く 8 体の AI エージェントによる SNS ヘルスチェック・自律振り返り API。Microsoft Agent Hackathon 2026 提出作品。"
  },
  "servers": [
    {
      "url": "https://func-aha-dev.azurewebsites.net"
    }
  ],
  "paths": {
    "/api/demo/analyze": {
      "post": {
        "summary": "SNS ヘルスチェック（認証不要・デモ用）",
        "operationId": "analyzeDemo",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tweet_text"
                ],
                "properties": {
                  "tweet_text": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "tweet_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "澪による診断結果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiskAnalysis"
                }
              }
            }
          }
        }
      }
    },
    "/api/night/summary": {
      "get": {
        "summary": "最新の夜間振り返りサマリーを取得",
        "operationId": "getNightSummary",
        "responses": {
          "200": {
            "description": "夜間ノクターンの集計結果"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RiskAnalysis": {
        "type": "object",
        "properties": {
          "risk_score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "risk_factors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "suggested_actions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "predicted_escalation_hours": {
            "type": "integer"
          },
          "summary": {
            "type": "string"
          }
        }
      }
    }
  }
}