openapi: 3.1.0
info:
  title: A1 Lab Contact API
  version: "1.0.0"
  description: >
    Public contact endpoint for A1 Lab (a1lab.com.br). See https://a1lab.com.br/docs/
    and https://a1lab.com.br/openapi.json.

    Versioning: current API is v1. Canonical path POST /v1/contact. POST /api/contact
    is a stable alias. Breaking changes ship under /v2. Deprecated versions receive
    Deprecation: true and Sunset (HTTP-date) at least 90 days before removal.

    Rate limits: 30 requests per hour per IP. Responses include RateLimit headers.
    HTTP 429 includes Retry-After.
  contact:
    name: A1 Lab
    email: contato@a1lab.com.br
    url: https://a1lab.com.br/docs/
servers:
  - url: https://a1lab.com.br
    description: Portuguese site
  - url: https://thea1lab.com
    description: English site
paths:
  /v1/contact:
    $ref: "#/paths/~1api~1contact"
  /api/contact:
    post:
      operationId: submitContact
      summary: Submit a contact request
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ContactRequest"
      responses:
        "200":
          description: Message accepted
        "400":
          description: Validation error
        "403":
          description: Captcha failed
        "405":
          description: Method not allowed
        "429":
          description: Rate limit exceeded
        "500":
          description: Server error
components:
  schemas:
    ContactRequest:
      type: object
      required: [name, email, subject, message]
      properties:
        name: { type: string, maxLength: 120 }
        email: { type: string, format: email, maxLength: 254 }
        company: { type: string, maxLength: 120 }
        subject: { type: string, maxLength: 120 }
        stage: { type: string, maxLength: 120 }
        message: { type: string, maxLength: 2000 }
        cf-turnstile-response: { type: string }
