Skip to main content

Quick Start

Get started with the Boxme Levelling API in 3 steps.

Step 1 — Login

curl -X POST https://boxme-levelling.pages.dev/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "admin"}'

# Response:
# { "success": true, "user": { "id": 1, "role": "bod", ... }, "token": "demo_token_1_bod" }

Step 2 — List Employees

curl https://boxme-levelling.pages.dev/api/employees?page=1&limit=10 \
-H "X-User-Id: 1"

# Response:
# { "data": [...], "total": 85, "page": 1, "limit": 10 }

Step 3 — Get Dashboard KPIs

curl "https://boxme-levelling.pages.dev/api/dashboard/stats?period=2026-02" \
-H "X-User-Id: 1"

# Response:
# { "total_employees": 85, "pph_distribution": [...], "pending_violations": 12, ... }

Response Formats

All API responses return JSON in one of these formats:

Success (List)

{
"data": [ ... ],
"total": 85,
"page": 1,
"limit": 20
}

Success (Action)

{
"success": true,
"id": 42
}

Error

{
"error": "Not found"
}

HTTP Status Codes: 200 (success), 400 (bad request), 401 (unauthorized), 404 (not found), 500 (server error)

Next Steps