{
  "openapi": "3.0.3",
  "info": {
    "title": "Nox Forge Labs OAW Pilot API",
    "version": "0.1.0",
    "description": "Public read-only catalog and consent-gated consultation requests. Requests are not confirmed appointments."
  },
  "servers": [
    {
      "url": "https://noxforgelabs.com"
    }
  ],
  "paths": {
    "/api/agent/services.php": {
      "get": {
        "operationId": "listServices",
        "summary": "List public services",
        "responses": {
          "200": {
            "description": "Public service catalog"
          }
        }
      }
    },
    "/api/agent/consultation.php": {
      "post": {
        "operationId": "requestConsultation",
        "summary": "Submit an unconfirmed consultation request to the CRM",
        "description": "Call only after explicitly confirming with the user. Preferred date/time is not guaranteed. Returns a pending request, not a booking.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "email",
                  "service_id",
                  "preferred_date",
                  "preferred_time",
                  "confirmed_by_user",
                  "idempotency_key"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 150
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "service_id": {
                    "type": "string",
                    "enum": [
                      "website",
                      "crm",
                      "automation",
                      "client_portal",
                      "custom_software"
                    ]
                  },
                  "preferred_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "preferred_time": {
                    "type": "string",
                    "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "es"
                    ]
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "confirmed_by_user": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "idempotency_key": {
                    "type": "string",
                    "minLength": 16,
                    "maxLength": 96
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing identical request replayed"
          },
          "202": {
            "description": "Pending request created; appointment NOT confirmed"
          },
          "403": {
            "description": "User confirmation missing"
          },
          "409": {
            "description": "Idempotency conflict"
          },
          "422": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "Temporary service problem"
          }
        }
      }
    }
  }
}
