{
  "openapi": "3.1.0",
  "info": {
    "title": "HRM Software API",
    "version": "v1",
    "description": "HRM Software APIs help organizations manage employee profiles, leave policies, departments, approvals, and workforce reports.",
    "contact": {
      "name": "Azeosoft Web Technologies",
      "url": "https://azeosoft.com"
    }
  },
  "servers": [
    {
      "url": "https://api-hrm.azeosoft.com/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Authenticate and verify access for HRM Software integrations."
    },
    {
      "name": "Employees",
      "description": "Create, read, update, and list employees in HRM Software."
    },
    {
      "name": "Leave Requests",
      "description": "Manage leave requests workflows in HRM Software."
    },
    {
      "name": "Reports",
      "description": "Export HRM Software analytics and operational summaries."
    }
  ],
  "paths": {
    "/auth/token": {
      "post": {
        "operationId": "hrm-token",
        "summary": "Create access token",
        "description": "Creates a short-lived access token for HRM Software API requests.",
        "tags": [
          "Authentication"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Access token returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "access_token": "az_live_token",
                    "token_type": "Bearer",
                    "expires_in": 3600
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "description": "Client credentials issued from the product admin panel.",
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "client_id": "hrm_client",
                "client_secret": "********"
              }
            }
          }
        }
      }
    },
    "/auth/profile": {
      "get": {
        "operationId": "hrm-profile",
        "summary": "Get integration profile",
        "description": "Returns organization and permission details for the authenticated HRM Software integration.",
        "tags": [
          "Authentication"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Integration profile returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "organizationId": "org_001",
                    "product": "HRM Software",
                    "scopes": [
                      "read",
                      "write"
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/employees": {
      "get": {
        "operationId": "hrm-list-records",
        "summary": "List employees",
        "description": "Returns a paginated list of employees for the organization.",
        "tags": [
          "Employees"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum records to return.",
            "schema": {
              "type": "integer"
            },
            "example": "50"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from the previous response.",
            "schema": {
              "type": "string"
            },
            "example": "next_abc123"
          }
        ],
        "responses": {
          "200": {
            "description": "Employees list returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "employee_id_001",
                        "name": "Alice Johnson",
                        "email": "alice@example.com",
                        "department": "Engineering",
                        "designation": "Developer"
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "hrm-create-record",
        "summary": "Create employees",
        "description": "Creates a new employees record.",
        "tags": [
          "Employees"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Employees created",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "employee_id_001",
                    "name": "Alice Johnson",
                    "email": "alice@example.com",
                    "department": "Engineering",
                    "designation": "Developer",
                    "created_at": "2026-07-26T09:00:00Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "description": "Employees fields.",
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "name": "Alice Johnson",
                "email": "alice@example.com",
                "department": "Engineering",
                "designation": "Developer"
              }
            }
          }
        }
      }
    },
    "/employees/{employee_id}": {
      "get": {
        "operationId": "hrm-get-record",
        "summary": "Get employees details",
        "description": "Returns details for a specific employees record.",
        "tags": [
          "Employees"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employees ID.",
            "schema": {
              "type": "string"
            },
            "example": "employee_id_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Employees details returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "employee_id_001",
                    "name": "Alice Johnson",
                    "email": "alice@example.com",
                    "department": "Engineering",
                    "designation": "Developer"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "hrm-update-record",
        "summary": "Update employees",
        "description": "Updates selected fields on a employees record.",
        "tags": [
          "Employees"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employees ID.",
            "schema": {
              "type": "string"
            },
            "example": "employee_id_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Employees updated",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "employee_id_001",
                    "status": "active",
                    "updated_at": "2026-07-26T10:00:00Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "description": "Partial Employees fields.",
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "status": "active"
              }
            }
          }
        }
      }
    },
    "/leave-requests": {
      "get": {
        "operationId": "hrm-workflow-list",
        "summary": "List leave requests",
        "description": "Returns workflow records used by HRM Software.",
        "tags": [
          "Leave Requests"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Leave Requests returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "flow_001",
                        "name": "Leave Requests",
                        "status": "active"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/leave-requests/actions": {
      "post": {
        "operationId": "hrm-workflow-action",
        "summary": "Create leave requests action",
        "description": "Creates an operational action inside the leave requests workflow.",
        "tags": [
          "Leave Requests"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Workflow action created",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "actionId": "act_001",
                    "status": "queued"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "description": "Workflow action payload.",
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "target_id": "employee_id_001",
                "action": "assign",
                "owner_id": "user_001",
                "note": "Assigned from API"
              }
            }
          }
        }
      }
    },
    "/reports/hr-summary": {
      "get": {
        "operationId": "hrm-summary-report",
        "summary": "HR summary report",
        "description": "Returns the hr summary report for a selected date range.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Start date in YYYY-MM-DD format.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "End date in YYYY-MM-DD format.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Report returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "from": "2026-07-01",
                    "to": "2026-07-26",
                    "totals": {
                      "records": 128,
                      "open": 18,
                      "closed": 110
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/reports/hr-summary/export": {
      "post": {
        "operationId": "hrm-export-report",
        "summary": "Export report",
        "description": "Creates a downloadable HRM Software report export.",
        "tags": [
          "Reports"
        ],
        "parameters": [],
        "responses": {
          "202": {
            "description": "Export queued",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "exportId": "exp_001",
                    "status": "processing"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "description": "Export options.",
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "format": "csv",
                "from": "2026-07-01",
                "to": "2026-07-26"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}
