Page cover

⚙️API Documentation

HRPBloom AI-HRMS API Documentation

Overview

HRPBloom AI-HRMS provides both Next.js API routes and Express server endpoints for comprehensive HR management functionality.

Base URLs

  • Next.js API: http://localhost:3000/api

  • Express Server: http://localhost:3001/api/v1

Authentication

All protected endpoints require JWT authentication via the Authorization header:

Authorization: Bearer <your-jwt-token>

Express Server Endpoints

Health Check

GET /health

Returns server health status and service availability.

Response:

{
  "status": "healthy",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "version": "1.0.1",
  "environment": "development",
  "services": {
    "database": "connected",
    "openai": "configured"
  },
  "uptime": 3600,
  "memory": {
    "rss": 50331648,
    "heapTotal": 20971520,
    "heapUsed": 15728640
  }
}

AI Agent Endpoints

Execute AI Agent Task

Parameters:

  • type: Agent type (HR_RECRUITER, PAYROLL_MANAGER, COMPLIANCE_OFFICER, TALENT_ADVISOR, CHAT_ASSISTANT)

Body:

Get AI Tasks

Chat with AI Assistant

Body:

Employee Management

Get All Employees

Get Employee by ID

Create Employee

Body:

Update Employee

Delete Employee

Payroll Management

Get Payroll Records

Calculate Payroll

Body:

Generate Payslip

Compliance Management

Get Compliance Status

Check PDPA Compliance

Get Statutory Deadlines

Integration Endpoints

EPF Integration

SOCSO Integration

LHDN Tax Submission

MyFutureJobs Integration

Document Management

Upload Document

Get Documents

Download Document

Reports

Generate Employee Report

Generate Payroll Report

Generate Compliance Report

Next.js API Routes

Chat Assistant

Body:

Employee Management

File Upload

Health Check

Error Responses

All endpoints return consistent error responses:

Common HTTP Status Codes

  • 200 - Success

  • 201 - Created

  • 400 - Bad Request

  • 401 - Unauthorized

  • 403 - Forbidden

  • 404 - Not Found

  • 429 - Too Many Requests

  • 500 - Internal Server Error

  • 503 - Service Unavailable

Rate Limiting

  • Default: 100 requests per 15 minutes per IP

  • Chat API: 20 requests per minute per user

  • File Upload: 10 requests per minute per user

Malaysian Government API Integrations

EPF/KWSP

  • Contribution calculations

  • Monthly submissions

  • Employee registration

SOCSO/Perkeso

  • Social security contributions

  • Claim submissions

  • Employee coverage

LHDN

  • Income tax calculations

  • PCB submissions

  • Tax clearance

HRDF

  • Training levy management

  • Grant applications

  • Training records

JTK

  • Safety compliance

  • Health regulations

  • Incident reporting

MyFutureJobs

  • Job posting synchronization

  • Application management

  • Candidate tracking

Environment Variables

Development

Start Development Servers

Build for Production

Testing API Endpoints

Use tools like Postman, Insomnia, or curl to test the endpoints:

Last updated

Was this helpful?