{
  "openapi": "3.1.0",
  "info": {
    "title": "Incerto Contact API",
    "description": "Incerto 公式サイト（https://www.incerto.tech）のお問い合わせフォーム送信用 API。フォーム入力をバリデーションし、社内通知チャンネルへ送信します。",
    "version": "1.0.0",
    "contact": {
      "name": "Incerto",
      "email": "info@incerto.tech",
      "url": "https://www.incerto.tech"
    }
  },
  "servers": [
    {
      "url": "https://www.incerto.tech"
    }
  ],
  "paths": {
    "/api/contact": {
      "post": {
        "summary": "お問い合わせ送信",
        "description": "問い合わせフォームの本送信エンドポイント。バリデーション通過後、社内通知が配信されます。短時間で連続送信した場合はレート制限が適用されます。",
        "operationId": "submitContact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactSubmitPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "送信成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "リクエスト形式不正、もしくはバリデーションエラー",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "レート制限超過（同一クライアントから 10 分間に 5 回まで）",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "サーバー側設定不備",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "通知配信先への送信失敗",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SuccessResponse": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string"
          }
        }
      },
      "InquiryIntent": {
        "type": "string",
        "enum": [
          "build",
          "adopt",
          "explore",
          "advise"
        ],
        "description": "相談タイプ。build=新しく作りたい / adopt=導入・改善したい / explore=方向性整理 / advise=技術相談"
      },
      "InquiryTrack": {
        "type": "string",
        "enum": [
          "aiSystem",
          "aiEnablement",
          "blockchain",
          "openclaw",
          "other"
        ],
        "description": "関心領域。aiSystem / aiEnablement / blockchain / openclaw / other"
      },
      "TimelineKey": {
        "type": "string",
        "enum": [
          "asap",
          "month",
          "quarter",
          "explore"
        ]
      },
      "BudgetKey": {
        "type": "string",
        "enum": [
          "undecided",
          "small",
          "medium",
          "large"
        ]
      },
      "PreparedInquiry": {
        "type": "object",
        "required": [
          "headline",
          "summary",
          "recommendedFocus",
          "followUpQuestions",
          "signal",
          "usedAi"
        ],
        "properties": {
          "headline": {
            "type": "string",
            "maxLength": 120
          },
          "summary": {
            "type": "string",
            "maxLength": 4000
          },
          "recommendedFocus": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 80
            }
          },
          "followUpQuestions": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 180
            }
          },
          "signal": {
            "type": "string"
          },
          "usedAi": {
            "type": "boolean"
          }
        }
      },
      "ContactSubmitPayload": {
        "type": "object",
        "required": [
          "intent",
          "tracks",
          "timeline",
          "budget",
          "objective",
          "currentSituation",
          "name",
          "email",
          "prepared"
        ],
        "properties": {
          "intent": {
            "$ref": "#/components/schemas/InquiryIntent"
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InquiryTrack"
            }
          },
          "timeline": {
            "$ref": "#/components/schemas/TimelineKey"
          },
          "budget": {
            "$ref": "#/components/schemas/BudgetKey"
          },
          "objective": {
            "type": "string",
            "minLength": 8,
            "description": "実現したいこと（必須）"
          },
          "currentSituation": {
            "type": "string"
          },
          "blockers": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "description": "お名前（必須）"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "メールアドレス（必須）"
          },
          "role": {
            "type": "string"
          },
          "preferredContact": {
            "type": "string"
          },
          "website": {
            "type": "string",
            "description": "ハニーポット用フィールド。値が入っている送信は黙って成功扱いとして無視されます。"
          },
          "prepared": {
            "$ref": "#/components/schemas/PreparedInquiry"
          }
        }
      }
    }
  }
}