{
  "openapi": "3.1.0",
  "info": {
    "title": "SamCorp Contact API",
    "version": "1.0.0",
    "description": "A SamCorp publikus kapcsolatfelvételi űrlapjának API-leírása. Üzenet küldése csak a felhasználó kifejezett szándékával történjen."
  },
  "servers": [
    {
      "url": "https://agentreadyweboldal.hu"
    }
  ],
  "paths": {
    "/api/contact": {
      "get": {
        "summary": "CSRF token kérése",
        "responses": {
          "200": {
            "description": "CSRF token és állapot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "A levelezési háttér nincs beállítva"
          }
        }
      },
      "post": {
        "summary": "Kapcsolatfelvételi üzenet küldése",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Elfogadott kapcsolatfelvétel"
          },
          "400": {
            "description": "Érvénytelen mezők"
          },
          "403": {
            "description": "Érvénytelen eredet vagy CSRF"
          },
          "429": {
            "description": "Küldési korlát"
          },
          "503": {
            "description": "A levelezési háttér nincs beállítva"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "required": [
          "name",
          "email",
          "service",
          "request_id",
          "csrf_token"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "company": {
            "type": "string",
            "maxLength": 150
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 200
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "website": {
            "type": "string",
            "format": "uri",
            "maxLength": 300
          },
          "service": {
            "type": "string"
          },
          "message": {
            "type": "string",
            "maxLength": 1500
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "csrf_token": {
            "type": "string"
          },
          "contact_guard": {
            "type": "string",
            "description": "Honeypot; must remain empty"
          }
        }
      }
    }
  }
}
