{
  "openapi": "3.0.3",
  "info": {
    "title": "Sri Ekaa Solutions API",
    "description": "Public API for Sri Ekaa Solutions: unauthenticated read endpoints over the product catalog and resources, plus the rate-limited enquiry endpoints behind our website's forms. No API key required. All responses, including errors, are JSON.\n\n**Versioning:** the read endpoints are versioned by URL path (`/api/v1/...`). The unversioned path (e.g. `/api/products`) is a permanent alias for the current version and will keep working. If we ever need a breaking change, it ships as a new version (`/api/v2/...`); the superseded version stays live for at least 6 months, marked with a `Deprecation` response header and a `Sunset` header giving the exact retirement date, and the change is announced on /developers before the clock starts. Every response also carries an `API-Version` header naming the version that served it.\n\n**Rate limits:** every endpoint returns the standard `RateLimit-Limit` / `RateLimit-Remaining` / `RateLimit-Reset` headers, plus `Retry-After` on a 429, so a client can self-throttle instead of guessing.",
    "version": "1.1.0",
    "contact": {
      "name": "Sri Ekaa Solutions Sales",
      "email": "sales@sriekaasolutions.com",
      "url": "https://www.sriekaasolutions.com/contact"
    }
  },
  "servers": [
    { "url": "/", "description": "Same-origin — deployed alongside the website" }
  ],
  "x-versioning-policy": {
    "scheme": "URL path (/api/v1/, /api/v2/, ...)",
    "currentVersion": "v1",
    "unversionedAlias": "/api/products and /api/resources always point at the current version",
    "deprecation": "A deprecated version is announced on /developers, kept live at minimum 6 months, and every response from it carries `Deprecation: true` and `Sunset: <date>` headers."
  },
  "paths": {
    "/api/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "List every product in the catalog",
        "description": "Public, unauthenticated, cacheable. Source of truth is the same data the website renders from — never out of sync.",
        "responses": {
          "200": {
            "description": "The full product catalog.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductList" } } }
          },
          "405": {
            "description": "Method other than GET.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (300 requests/5 minutes per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    },
    "/api/products/{slug}": {
      "get": {
        "operationId": "getProduct",
        "summary": "Get one product by slug",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" }, "example": "molykote-p40-paste" }
        ],
        "responses": {
          "200": {
            "description": "The requested product.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Product" } } }
          },
          "404": {
            "description": "No product with that slug.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (300 requests/5 minutes per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    },
    "/api/resources": {
      "get": {
        "operationId": "listResources",
        "summary": "List every buying-guide article",
        "description": "Public, unauthenticated, cacheable. Returns summaries only — call GET /api/resources/{slug} for the full article content.",
        "responses": {
          "200": {
            "description": "The full resources index.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResourceList" } } }
          },
          "405": {
            "description": "Method other than GET.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (300 requests/5 minutes per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    },
    "/api/resources/{slug}": {
      "get": {
        "operationId": "getResource",
        "summary": "Get one full resource article by slug",
        "description": "Includes the full `content` array of structured blocks (paragraphs, headings, lists, callouts) that make up the article.",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" }, "example": "vci-corrosion-protection-aerospace-storage-guide" }
        ],
        "responses": {
          "200": {
            "description": "The requested article, in full.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Resource" } } }
          },
          "404": {
            "description": "No resource article with that slug.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (300 requests/5 minutes per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    },
    "/api/v1/products": {
      "get": {
        "operationId": "listProductsV1",
        "summary": "List every product in the catalog (v1, explicit)",
        "description": "Identical response to GET /api/products, which is a permanent alias for this version. Prefer this URL if you want to pin to a specific API version.",
        "responses": {
          "200": {
            "description": "The full product catalog.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductList" } } }
          },
          "405": {
            "description": "Method other than GET.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (300 requests/5 minutes per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    },
    "/api/v1/products/{slug}": {
      "get": {
        "operationId": "getProductV1",
        "summary": "Get one product by slug (v1, explicit)",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" }, "example": "molykote-p40-paste" }
        ],
        "responses": {
          "200": {
            "description": "The requested product.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Product" } } }
          },
          "404": {
            "description": "No product with that slug.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (300 requests/5 minutes per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    },
    "/api/v1/resources": {
      "get": {
        "operationId": "listResourcesV1",
        "summary": "List every buying-guide article (v1, explicit)",
        "description": "Identical response to GET /api/resources, which is a permanent alias for this version.",
        "responses": {
          "200": {
            "description": "The full resources index.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResourceList" } } }
          },
          "405": {
            "description": "Method other than GET.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (300 requests/5 minutes per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    },
    "/api/v1/resources/{slug}": {
      "get": {
        "operationId": "getResourceV1",
        "summary": "Get one full resource article by slug (v1, explicit)",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" }, "example": "vci-corrosion-protection-aerospace-storage-guide" }
        ],
        "responses": {
          "200": {
            "description": "The requested article, in full.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Resource" } } }
          },
          "404": {
            "description": "No resource article with that slug.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (300 requests/5 minutes per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    },
    "/api/contact": {
      "post": {
        "operationId": "submitContactEnquiry",
        "summary": "Submit a sales/support enquiry",
        "description": "Sends an enquiry to the Sri Ekaa Solutions sales team and an acknowledgment email to the submitter. Rate-limited to 5 requests/hour per client IP.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContactRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Enquiry accepted and emailed (or silently dropped as spam via the honeypot field).",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SuccessResponse" }
              }
            }
          },
          "400": {
            "description": "Missing or invalid fields.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "405": {
            "description": "Method other than POST.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (5 requests/hour per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "500": {
            "description": "Email delivery failed.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    },
    "/api/download-request": {
      "post": {
        "operationId": "submitCatalogDownloadRequest",
        "summary": "Request a product catalog download by email",
        "description": "Sends a catalog request to the sales team and an acknowledgment email to the submitter. Rate-limited to 10 requests/hour per client IP.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/DownloadRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request accepted and emailed (or silently dropped as spam via the honeypot field).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } }
          },
          "400": {
            "description": "Missing or invalid fields.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "405": {
            "description": "Method other than POST.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "429": {
            "description": "Rate limit exceeded (10 requests/hour per IP).",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          },
          "500": {
            "description": "Email delivery failed.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Product": {
        "type": "object",
        "properties": {
          "slug": { "type": "string", "example": "molykote-p40-paste" },
          "name": { "type": "string", "example": "Molykote P-40 Paste" },
          "brand": { "type": "string", "example": "Molykote" },
          "category": { "type": "string", "example": "Greases & Lubricants" },
          "description": { "type": "string" },
          "compliance": { "type": "array", "items": { "type": "string" }, "example": ["RT362", "EN 14470-1"], "description": "Standards the product line is certified to. Present only on products that declare them." },
          "keywords": { "type": "array", "items": { "type": "string" }, "description": "Extra search terms such as model references. Present only on products that declare them." },
          "url": { "type": "string", "format": "uri", "description": "Canonical HTML page for this product." }
        }
      },
      "ProductList": {
        "type": "object",
        "properties": {
          "count": { "type": "integer" },
          "products": { "type": "array", "items": { "$ref": "#/components/schemas/Product" } }
        }
      },
      "ResourceSummary": {
        "type": "object",
        "properties": {
          "slug": { "type": "string" },
          "title": { "type": "string" },
          "category": { "type": "string" },
          "excerpt": { "type": "string" },
          "publishDate": { "type": "string", "format": "date" },
          "readTime": { "type": "string", "example": "7 min read" },
          "url": { "type": "string", "format": "uri" }
        }
      },
      "Resource": {
        "allOf": [
          { "$ref": "#/components/schemas/ResourceSummary" },
          {
            "type": "object",
            "properties": {
              "metaDescription": { "type": "string" },
              "content": {
                "type": "array",
                "description": "Structured content blocks making up the article body.",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": { "type": "string", "enum": ["p", "h2", "h3", "ul", "note"] },
                    "text": { "type": "string" },
                    "items": { "type": "array", "items": { "type": "string" } }
                  }
                }
              },
              "relatedLink": {
                "type": "object",
                "nullable": true,
                "properties": { "label": { "type": "string" }, "href": { "type": "string" } }
              }
            }
          }
        ]
      },
      "ResourceList": {
        "type": "object",
        "properties": {
          "count": { "type": "integer" },
          "resources": { "type": "array", "items": { "$ref": "#/components/schemas/ResourceSummary" } }
        }
      },
      "ContactRequest": {
        "type": "object",
        "required": ["first_name", "email", "subject", "message"],
        "properties": {
          "first_name": { "type": "string", "maxLength": 100 },
          "last_name": { "type": "string", "maxLength": 100 },
          "email": { "type": "string", "format": "email", "maxLength": 254 },
          "phone": { "type": "string" },
          "company": { "type": "string" },
          "gst_number": {
            "type": "string",
            "description": "15-character Indian GST number. Required when `subject` is one of: Request a Quote, Product Information, Technical Support, Partnership Inquiry, Other Inquiry, Free Sample Request.",
            "pattern": "^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z][1-9A-Z]Z[0-9A-Z]$"
          },
          "subject": {
            "type": "string",
            "maxLength": 200,
            "enum": [
              "Request a Quote", "Product Information", "Technical Support",
              "Partnership Inquiry", "Other Inquiry", "Free Sample Request",
              "Product Enquiry", "Chatbot Enquiry"
            ]
          },
          "message": { "type": "string", "maxLength": 4000 },
          "website": {
            "type": "string",
            "description": "Honeypot field. Leave empty — a non-empty value is treated as spam and the request is silently accepted without sending email."
          }
        }
      },
      "DownloadRequest": {
        "type": "object",
        "required": ["name", "email", "catalog"],
        "properties": {
          "name": { "type": "string", "maxLength": 100 },
          "email": { "type": "string", "format": "email", "maxLength": 254 },
          "phone": { "type": "string", "maxLength": 20 },
          "company": { "type": "string", "maxLength": 200 },
          "catalog": { "type": "string", "maxLength": 200, "description": "Name of the catalog being requested." },
          "website": {
            "type": "string",
            "description": "Honeypot field. Leave empty — a non-empty value is treated as spam and the request is silently accepted without sending email."
          }
        }
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": true }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error identifier.",
                "enum": [
                  "method_not_allowed", "missing_fields", "invalid_subject",
                  "input_too_long", "invalid_email", "invalid_gst_number",
                  "rate_limited", "email_delivery_failed", "not_found"
                ]
              },
              "message": { "type": "string", "description": "Human-readable description of what went wrong." },
              "hint": { "type": "string", "description": "Suggested next step to resolve the error." }
            }
          }
        }
      }
    }
  }
}
