{
  "openapi": "3.0.3",
  "info": {
    "title": "TeamIN HR API",
    "version": "2.8.1",
    "description": "Public OpenAPI description for TeamIN HR. Authenticated HR routes require a Bearer token from /auth/login.",
    "contact": {
      "name": "TeamIN",
      "url": "https://teamin-hr.com",
      "email": "roi.agency.dev@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://api-roi-v2.hostly-eg.com/api",
      "description": "TeamIN API"
    }
  ],
  "tags": [
    { "name": "Auth" },
    { "name": "Leads" }
  ],
  "paths": {
    "/auth/login": {
      "post": {
        "tags": ["Auth"],
        "summary": "Exchange email and password for a Bearer token",
        "operationId": "login",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email", "password"],
                "properties": {
                  "email": { "type": "string", "format": "email" },
                  "password": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Login succeeded" },
          "401": { "description": "Invalid credentials" }
        }
      }
    },
    "/auth/register": {
      "post": {
        "tags": ["Auth"],
        "summary": "Register a tenant or user",
        "operationId": "register",
        "responses": {
          "200": { "description": "Registration accepted" },
          "400": { "description": "Validation error" }
        }
      }
    },
    "/auth/refresh": {
      "post": {
        "tags": ["Auth"],
        "summary": "Refresh an access token",
        "operationId": "refreshToken",
        "responses": {
          "200": { "description": "Token refreshed" }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "tags": ["Auth"],
        "summary": "Revoke the current session",
        "operationId": "logout",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Logged out" }
        }
      }
    },
    "/auth/forget-password": {
      "post": {
        "tags": ["Auth"],
        "summary": "Start a password reset",
        "operationId": "forgetPassword",
        "responses": {
          "200": { "description": "Reset email sent if the account exists" }
        }
      }
    },
    "/admin/leads/register": {
      "post": {
        "tags": ["Leads"],
        "summary": "Join the product waiting list",
        "operationId": "registerLead",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email", "phone", "category"],
                "properties": {
                  "email": { "type": "string", "format": "email" },
                  "phone": { "type": "string" },
                  "category": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Lead stored" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
