{
  "openapi": "3.0.3",
  "info": {
    "title": "Jachai public API",
    "version": "1.0.0",
    "description": "Fraud-check results for Bangladesh. Free for low-volume, non-commercial use, up to 30 requests per minute per address. For organisational, commercial or high-volume use write to support@mangroveintel.com. A result is a warning signal, not a legal finding.",
    "contact": { "name": "Mangrove Intelligence", "email": "support@mangroveintel.com", "url": "https://jachai.mangroveintel.com/en/for-organisations" }
  },
  "servers": [{ "url": "https://jachai.mangroveintel.com" }],
  "paths": {
    "/api/check": {
      "post": {
        "summary": "Check a message, phone number, link or organisation name",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": {
            "type": "object",
            "required": ["text"],
            "properties": {
              "text": { "type": "string", "maxLength": 6000, "description": "The message, number, link or name to check." },
              "lang": { "type": "string", "enum": ["bn", "en"], "description": "Language of the plain-language reasons and advice." },
              "example": { "type": "boolean", "description": "If true the check is not logged. Use for tests." },
              "consent": { "type": "boolean", "description": "If true, the person agrees the message text may be stored (with phone numbers, e-mail addresses, OTPs and long numbers masked) to improve the service. Leave false for automated use." }
            }
          } } }
        },
        "responses": {
          "200": { "description": "A result.", "content": { "application/json": { "schema": {
            "type": "object",
            "properties": {
              "verdict": { "type": "string", "enum": ["unknown", "registered", "caution", "danger"] },
              "helpRoute": { "type": "boolean", "description": "True when the person seems to need help after a loss rather than a check." },
              "reasons": { "type": "array", "items": { "type": "string" } },
              "advice": { "type": "string" },
              "categories": { "type": "array", "items": { "type": "object" } },
              "registry": { "type": "array", "items": { "type": "object" }, "description": "Matching entries in official registers." },
              "identifiers": { "type": "array", "items": { "type": "object" } },
              "token": { "type": "string" }
            }
          } } } },
          "400": { "description": "Empty text or invalid JSON." },
          "413": { "description": "Request too large." },
          "429": { "description": "Too many requests from this address. Wait for the number of seconds in the Retry-After header." }
        }
      }
    },
    "/api/meta": {
      "get": {
        "summary": "Helplines, registers with capture dates, category labels",
        "responses": { "200": { "description": "Reference data for the country served.", "content": { "application/json": { "schema": {
          "type": "object",
          "properties": {
            "country": { "type": "string" },
            "currency": { "type": "string" },
            "helplines": { "type": "array", "items": { "type": "object" } },
            "registers": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "label": { "type": "object" }, "url": { "type": "string" }, "as_of": { "type": "string", "nullable": true } } } },
            "categories": { "type": "object" },
            "engine_version": { "type": "string" }
          }
        } } } } }
      }
    }
  }
}
