{
  "openapi": "3.1.0",
  "info": {
    "title": "NG-NeXT Tech public API",
    "version": "1.0.1",
    "summary": "Send an enquiry to NG-NeXT Tech, or request a 20-minute private-cloud call.",
    "description": "For people and AI agents acting for them. No API key. Browsers include a Turnstile token; agents omit it, leave `website` empty and are limited to 3 requests per hour per IP. Each request sends one email to the NG-NeXT team. Do not send on a user's behalf without their consent.",
    "contact": {
      "name": "NG-NeXT Tech",
      "email": "info@ngnext.tech",
      "url": "https://ngnext.tech/contact"
    }
  },
  "servers": [
    {
      "url": "https://ngnext.tech"
    }
  ],
  "paths": {
    "/api/enquiry": {
      "post": {
        "operationId": "sendEnquiry",
        "summary": "Send an enquiry to the NG-NeXT team (any topic, including Shelfstone Books).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Lead"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "403": {
            "description": "Turnstile token rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. See Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "502": {
            "description": "Mail could not be sent. Email info@ngnext.tech instead."
          }
        }
      }
    },
    "/api/booking": {
      "post": {
        "operationId": "requestCall",
        "summary": "Request a 20-minute private-cloud call or KnowledgeHub demo. Returns the booking link. Does not create a calendar event.",
        "description": "Only for private cloud, RootServe, cloud repatriation, dedicated servers and KnowledgeHub demos. For Shelfstone Books and anything else, use POST /api/enquiry.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Lead"
                  }
                ],
                "properties": {
                  "preferredTime": {
                    "type": "string",
                    "maxLength": 120
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "403": {
            "description": "Turnstile token rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Result"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. See Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "502": {
            "description": "Mail could not be sent. Email info@ngnext.tech instead."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Lead": {
        "type": "object",
        "required": [
          "name",
          "email"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "company": {
            "type": "string",
            "maxLength": 160
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "need": {
            "type": "string",
            "maxLength": 1000,
            "description": "What you want to build or solve."
          },
          "timeline": {
            "type": "string",
            "maxLength": 120
          },
          "message": {
            "type": "string",
            "maxLength": 4000
          },
          "source": {
            "type": "string",
            "maxLength": 60,
            "description": "Free text, e.g. the name of the agent or tool sending this."
          },
          "turnstileToken": {
            "type": "string",
            "description": "Cloudflare Turnstile token. Browsers send it; agents omit it and are rate limited harder."
          },
          "website": {
            "type": "string",
            "description": "Honeypot. Must be absent or empty."
          }
        },
        "additionalProperties": false
      },
      "Result": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "BookingResult": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "bookingUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}