openapi: 3.1.0
info:
  title: On the Hill Tutoring API
  version: 1.0.0
  description: >
    Public discovery and consultation-booking helpers for On the Hill Tutoring.
    Prefer llms.txt and WebMCP for content; use these endpoints for structured agent workflows.
  contact:
    name: On the Hill Tutoring
    url: https://www.onthehilltutoring.com/
servers:
  - url: https://www.onthehilltutoring.com/api
paths:
  /status:
    get:
      operationId: getStatus
      summary: Health / status
      responses:
        "200":
          description: Service is healthy
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  service:
                    type: string
  /services:
    get:
      operationId: listServices
      summary: List tutoring services
      security:
        - bearerAuth: ["services:read"]
      responses:
        "200":
          description: Service catalogue
          content:
            application/json:
              schema:
                type: object
                properties:
                  services:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        description:
                          type: string
  /consultation:
    get:
      operationId: getConsultationLink
      summary: Complimentary consultation booking link
      security:
        - bearerAuth: ["consultation:book"]
      responses:
        "200":
          description: Booking URL
          content:
            application/json:
              schema:
                type: object
                properties:
                  booking_url:
                    type: string
                    format: uri
                  method:
                    type: string
  /enquiries:
    post:
      operationId: createEnquiry
      summary: Submit a tutoring enquiry
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [name, email, whatsapp, preferred_contact, requirements]
              properties:
                name:
                  type: string
                email:
                  type: string
                  format: email
                whatsapp:
                  type: string
                preferred_contact:
                  type: string
                  enum: [email, whatsapp, either]
                requirements:
                  type: string
      responses:
        "201":
          description: Enquiry stored
        "400":
          description: Validation error
    get:
      operationId: listEnquiries
      summary: List stored enquiries (admin)
      parameters:
        - in: header
          name: X-Admin-Key
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Enquiry list
        "401":
          description: Unauthorized
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
