{
  "openapi": "3.1.0",
  "info": {
    "title": "Nero Contact API",
    "description": "Contact / quote intake for Nero (nero.surf), independent web agency in Vichy, France.\n\n**Public agents:** do not call this endpoint anonymously. Send end users to https://nero.surf/contact instead.\n\n**Auth (internal):**\n- Browser form on nero.surf: Cloudflare Turnstile.\n- Nero-owned integrations only: Authorization Bearer with a private CONTACT_API_KEY (not distributed publicly).\n\nRate limits apply. Honeypot field botcheck must be empty.",
    "version": "1.1.1",
    "contact": {
      "name": "Nero",
      "email": "contact@nero.surf",
      "url": "https://nero.surf/developers"
    }
  },
  "servers": [{ "url": "https://nero.surf", "description": "Production" }],
  "tags": [{ "name": "Contact", "description": "Human quote / contact intake" }],
  "paths": {
    "/api/contact": {
      "post": {
        "operationId": "submitContactQuote",
        "summary": "Submit a quote request (protected)",
        "description": "Sends email to the Nero team. Public anonymous use is not supported. Prefer https://nero.surf/contact for end users. Machine access requires a private API key held only by Nero.",
        "tags": ["Contact"],
        "security": [{ "ContactApiKey": [] }, {}],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContactRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContactSuccess" }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ApiError" }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ApiError" }
              }
            }
          },
          "403": {
            "description": "Turnstile or origin failed",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ApiError" }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ApiError" }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ApiError" }
              }
            }
          },
          "500": {
            "description": "Config error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ApiError" }
              }
            }
          },
          "502": {
            "description": "Upstream email failure",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ApiError" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ContactApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Private key for Nero-owned tools only. Not issued to the public."
      }
    },
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "required": ["name", "email", "message"],
        "additionalProperties": false,
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 200 },
          "business": { "type": "string", "maxLength": 200 },
          "email": { "type": "string", "format": "email", "maxLength": 254 },
          "message": { "type": "string", "minLength": 1, "maxLength": 5000 },
          "botcheck": { "type": "string", "description": "Honeypot; must be empty" },
          "cf-turnstile-response": {
            "type": "string",
            "description": "Browser Turnstile token; not used with valid private Bearer key"
          }
        }
      },
      "ContactSuccess": {
        "type": "object",
        "required": ["success"],
        "properties": {
          "success": { "type": "boolean", "const": true },
          "message": { "type": "string" }
        }
      },
      "ApiError": {
        "type": "object",
        "required": ["success", "error", "message"],
        "properties": {
          "success": { "type": "boolean", "const": false },
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "method_not_allowed",
                  "unauthorized",
                  "origin_forbidden",
                  "rate_limited",
                  "turnstile_failed",
                  "validation_failed",
                  "invalid_email",
                  "config_error",
                  "upstream_error"
                ]
              },
              "message": { "type": "string" },
              "resolution": { "type": "string" }
            }
          },
          "message": { "type": "string" }
        }
      }
    }
  }
}
