{
  "openapi": "3.1.0",
  "info": {
    "title": "Omegamatrix website API",
    "version": "1.0.0",
    "summary": "Ask about Omegamatrix products, see free demo slots, book a 30-minute demo or leave an enquiry.",
    "description": "Public endpoints behind omega-cst.com, the website of Omegamatrix (business software for the UAE, GCC and India: PENTAXIS e-invoicing, NeatAccounts, TaktProduction, MaxLaundry and more). No API key is needed. Requests are rate-limited per IP (enquiries: 10 per hour, bookings: 5 per hour, questions: 40 per hour). Only send a person's details when that person has asked you to contact Omegamatrix for them. Times are Gulf Standard Time (Asia/Dubai) unless stated.",
    "contact": { "name": "Omegamatrix", "email": "info@omega-cst.com", "url": "https://omega-cst.com/contact" },
    "termsOfService": "https://omega-cst.com/terms"
  },
  "externalDocs": { "description": "About the site for AI agents and developers", "url": "https://omega-cst.com/developers" },
  "servers": [{ "url": "https://omega-cst.com/api/v1" }],
  "paths": {
    "/chat": {
      "post": {
        "operationId": "askQuestion",
        "summary": "Ask a question about Omegamatrix products, services, e-invoicing dates or pricing",
        "description": "Answers come from the team's approved answers and the FAQs on the website (no outside AI service). If no confident answer exists, the reply offers a call back or WhatsApp.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["message"],
                "properties": {
                  "message": { "type": "string", "maxLength": 800, "examples": ["Does PENTAXIS work with Tally?"] },
                  "conversation_id": { "type": "string", "description": "Returned by the first reply; send it back to continue the same conversation." },
                  "page": { "type": "string", "description": "Page the question relates to, e.g. /products/pentaxis" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "reply": { "type": "string" },
                    "conversation_id": { "type": "string" },
                    "links": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "label": { "type": "string" } } } },
                    "actions": { "type": "array", "items": { "type": "string", "enum": ["demo", "whatsapp", "call"] } }
                  }
                }
              }
            }
          },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/booking": {
      "get": {
        "operationId": "listDemoSlots",
        "summary": "List free 30-minute demo slots for the coming working days",
        "responses": {
          "200": {
            "description": "Free slots",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "timezone": { "type": "string", "examples": ["Asia/Dubai"] },
                    "duration": { "type": "integer", "description": "Minutes" },
                    "days": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": { "type": "string", "format": "date" },
                          "label": { "type": "string" },
                          "slots": { "type": "array", "items": { "type": "object", "properties": { "start": { "type": "string", "format": "date-time" }, "time": { "type": "string" } } } }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      },
      "post": {
        "operationId": "bookDemo",
        "summary": "Book a demo call in one of the free slots",
        "description": "Adds the call to the Omegamatrix team calendar and records the enquiry. The person receives a confirmation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["start", "name", "phone"],
                "properties": {
                  "start": { "type": "string", "format": "date-time", "description": "A slot start time from listDemoSlots" },
                  "name": { "type": "string", "minLength": 2, "maxLength": 120 },
                  "phone": { "type": "string", "description": "Mobile or WhatsApp number with country code", "maxLength": 40 },
                  "email": { "type": "string", "format": "email", "maxLength": 190 },
                  "company": { "type": "string", "maxLength": 190 },
                  "enquiryType": { "type": "string", "description": "Product or topic, e.g. PENTAXIS, NeatAccounts, TaktProduction, MaxLaundry, Integration", "maxLength": 160 },
                  "message": { "type": "string", "maxLength": 3000 }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Booked", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "id": { "type": "integer" }, "when": { "type": "string" } } } } } },
          "409": { "description": "That time was just taken; list the slots again" },
          "422": { "description": "Missing name/phone or a time in the past" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "503": { "$ref": "#/components/responses/Unavailable" }
        }
      }
    },
    "/lead": {
      "post": {
        "operationId": "sendEnquiry",
        "summary": "Send an enquiry to the Omegamatrix team (reply within one business day)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name"],
                "description": "Give a phone/WhatsApp number or an email address.",
                "properties": {
                  "name": { "type": "string", "minLength": 2, "maxLength": 120 },
                  "email": { "type": "string", "format": "email", "maxLength": 190 },
                  "phone": { "type": "string", "maxLength": 40 },
                  "company": { "type": "string", "maxLength": 190 },
                  "enquiryType": { "type": "string", "maxLength": 160 },
                  "message": { "type": "string", "maxLength": 3000 }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Received", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "id": { "type": "integer" } } } } } },
          "422": { "description": "Name, or both phone and email, missing" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    }
  },
  "components": {
    "responses": {
      "RateLimited": { "description": "Too many requests from this connection; try later or WhatsApp +971 50 900 7670" },
      "Unavailable": { "description": "Booking is switched off or the calendar is unreachable; use sendEnquiry instead" }
    }
  }
}
