Skip to content

AIHR BD API Reference

Quickstart guide, sample requests and the full interactive OpenAPI spec.

Quickstart

Read your HRM data from any third-party app in three steps.

1

Generate an API key

Open Integrations → API Keys, click New Key, copy it (only shown once).

2

Send the header

Pass the key in x-api-key on every request.
3

Call an endpoint

GET /employees, /attendance or /payroll.

Authentication

The public API uses an API key in the x-api-key header. Each key is scoped to a single company and respects row-level security.

header
x-api-key: aihr_live_••••••••••••••••

Never ship API keys in client-side bundles. Use a server / serverless proxy and store the key in environment secrets.

Endpoint examples

GET

GET /api/public/hrm/employees

List active and former employees of your company. Use limit (default 100, max 500) for pagination.

Request

bash
curl -H "x-api-key: $AIHR_KEY" \
  "https://aihrbd.com/api/public/hrm/employees?limit=10"

200 OK Response

json
{
  "data": [
    {
      "id": "8f1a2b30-c8e2-4a4d-9b97-2e1c1f3aab01",
      "employee_id": "EMP-0001",
      "name": "Rakib Hasan",
      "email": "rakib@example.com",
      "designation": "Software Engineer",
      "department": "Engineering",
      "gross_salary": 65000,
      "basic_salary": 39000,
      "join_date": "2024-03-15",
      "status": "Active"
    }
  ]
}
GET

GET /api/public/hrm/attendance

Fetch attendance entries within a date range. from and to are inclusive YYYY-MM-DD dates.

Request

bash
curl -H "x-api-key: $AIHR_KEY" \
  "https://aihrbd.com/api/public/hrm/attendance?from=2026-01-01&to=2026-01-31"

200 OK Response

json
{
  "data": [
    {
      "id": "a1c2-...",
      "employee_id": "8f1a2b30-c8e2-4a4d-9b97-2e1c1f3aab01",
      "date": "2026-01-15",
      "check_in": "09:01:23",
      "check_out": "18:05:11",
      "status": "Present"
    }
  ]
}
GET

GET /api/public/hrm/payroll

Return payroll rows for a given month and year. Status can be pending, processed or paid.

Request

bash
curl -H "x-api-key: $AIHR_KEY" \
  "https://aihrbd.com/api/public/hrm/payroll?month=1&year=2026"

200 OK Response

json
{
  "data": [
    {
      "id": "p1q2-...",
      "employee_id": "8f1a2b30-c8e2-4a4d-9b97-2e1c1f3aab01",
      "month": 1,
      "year": 2026,
      "basic_salary": 39000,
      "net_salary": 61450,
      "tax": 1500,
      "provident_fund": 2050,
      "status": "paid",
      "paid_at": "2026-02-02T10:15:32Z"
    }
  ]
}

Error codes

StatusWhenBody
400
Invalid request body or missing field{ "error": "Field 'email' is required" }
401
Missing / invalid / revoked API key{ "error": "Invalid or revoked API key" }
403
Key lacks the required scope (e.g. write){ "error": "API key lacks write scope" }
404
Unknown endpoint path{ "error": "Not found" }
500
Server-side issue — retry with backoff{ "error": "Internal server error" }

API reference

Browse the full schema of the public read-only endpoints. For your safety, live requests are disabled here — never paste a production API key into a browser page; call the API from your server using the samples above.

Loading reference...