{
  "openapi": "3.1.0",
  "info": {
    "title": "Aviyan Investment Group of Nepal Limited Agent API",
    "version": "1.0.0",
    "description": "Read-only official company and investor-resource indexes. Public content is not individualized investment advice or an offer to invest."
  },
  "servers": [
    { "url": "https://aviyaninvestmentgroupofnepal.com", "description": "Canonical production site" },
    { "url": "https://shimmering-smakager-2ab89a.netlify.app", "description": "Netlify deployment" }
  ],
  "paths": {
    "/api/v1/site": {
      "get": {
        "operationId": "getSiteIndex",
        "summary": "Get Aviyan public company and resource information",
        "security": [],
        "responses": {
          "200": {
            "description": "Public company and resource index",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SiteIndex" } } }
          }
        }
      }
    },
    "/api/v1/investor-resources": {
      "get": {
        "operationId": "listInvestorResources",
        "summary": "List approved investor-resource references",
        "description": "Requires an Aviyan-issued API key with the investor.resources:read role. This endpoint does not expose investor accounts or document contents.",
        "security": [{ "AgentApiKey": [] }],
        "x-required-roles": ["investor.resources:read"],
        "responses": {
          "200": { "description": "Approved investor-resource references", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResourceList" } } } },
          "401": { "description": "Missing or invalid API key" },
          "403": { "description": "Valid API key lacks investor.resources:read" },
          "503": { "description": "Protected access is not configured" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AgentApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Role-limited API key formatted as: Bearer <key>. Available role: investor.resources:read."
      }
    },
    "schemas": {
      "Link": {
        "type": "object",
        "required": ["name", "url"],
        "properties": { "name": { "type": "string" }, "url": { "type": "string", "format": "uri" } }
      },
      "SiteIndex": {
        "type": "object",
        "required": ["name", "canonicalUrl", "contact", "resources"],
        "properties": {
          "name": { "type": "string" },
          "canonicalUrl": { "type": "string", "format": "uri" },
          "description": { "type": "string" },
          "contact": { "type": "object", "additionalProperties": { "type": "string" } },
          "resources": { "type": "array", "items": { "$ref": "#/components/schemas/Link" } }
        }
      },
      "ResourceList": {
        "type": "object",
        "required": ["requiredRole", "resources"],
        "properties": {
          "requiredRole": { "const": "investor.resources:read" },
          "resources": { "type": "array", "items": { "$ref": "#/components/schemas/Link" } }
        }
      }
    }
  }
}
