Skip to content

Attendance API

Endpoints for managing attendance records and clock-in/clock-out operations.

Base path: /api/v1/attendance


List Attendance Records

http
GET /api/v1/attendance
Authorization: Bearer {token}

Query Parameters

ParameterTypeDescription
employee_idintegerFilter by employee
department_idintegerFilter by department
datedateFilter by specific date (YYYY-MM-DD)
date_fromdateStart of date range
date_todateEnd of date range
monthintegerFilter by month (1–12)
yearintegerFilter by year
statusstringpresent, late, absent, half_day, holiday, weekend, on_leave
pageintegerPage number
per_pageintegerRecords per page (default: 15)

Example Request

http
GET /api/v1/attendance?employee_id=42&month=4&year=2026
Authorization: Bearer {token}

Response

json
{
  "success": true,
  "data": [
    {
      "id": 1201,
      "employee": {
        "id": 42,
        "employee_id": "EMP-042",
        "full_name": "John Doe"
      },
      "date": "2026-04-01",
      "day": "Wednesday",
      "check_in": "08:55",
      "check_out": "17:30",
      "total_hours": 8.58,
      "status": "present",
      "notes": null,
      "created_at": "2026-04-01T08:55:00.000000Z"
    },
    {
      "id": 1202,
      "employee": {
        "id": 42,
        "employee_id": "EMP-042",
        "full_name": "John Doe"
      },
      "date": "2026-04-02",
      "day": "Thursday",
      "check_in": "09:20",
      "check_out": "17:45",
      "total_hours": 8.42,
      "status": "late",
      "notes": "Traffic delay",
      "created_at": "2026-04-02T09:20:00.000000Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 2,
    "per_page": 15,
    "total": 22
  }
}

Check In

Record an employee's check-in time. Used by kiosks, mobile apps, or manual entry.

http
POST /api/v1/attendance/check-in
Authorization: Bearer {token}
Content-Type: application/json

Request Body

json
{
  "employee_id": 42,
  "check_in_time": "2026-04-03T08:55:00Z",
  "location": "Main Office",
  "device_id": "KIOSK-01",
  "notes": "Optional notes"
}
FieldRequiredDescription
employee_idYesEmployee ID (integer)
check_in_timeNoISO 8601 datetime. Defaults to current server time if omitted.
locationNoPhysical location or "Remote"
device_idNoIdentifier of the check-in device
notesNoOptional notes

Response

HTTP 201 Created

json
{
  "success": true,
  "message": "Check-in recorded successfully",
  "data": {
    "id": 1250,
    "employee_id": 42,
    "date": "2026-04-03",
    "check_in": "08:55",
    "status": "present",
    "location": "Main Office"
  }
}

Error — Already Checked In

HTTP 422

json
{
  "success": false,
  "message": "Employee EMP-042 has already checked in today."
}

Check Out

Record an employee's check-out time.

http
POST /api/v1/attendance/check-out
Authorization: Bearer {token}
Content-Type: application/json

Request Body

json
{
  "employee_id": 42,
  "check_out_time": "2026-04-03T17:30:00Z",
  "notes": "Leaving on time"
}
FieldRequiredDescription
employee_idYesEmployee ID (integer)
check_out_timeNoISO 8601 datetime. Defaults to current server time if omitted.
notesNoOptional notes

Response

json
{
  "success": true,
  "message": "Check-out recorded successfully",
  "data": {
    "id": 1250,
    "employee_id": 42,
    "date": "2026-04-03",
    "check_in": "08:55",
    "check_out": "17:30",
    "total_hours": 8.58,
    "status": "present"
  }
}

Error — Not Checked In

HTTP 422

json
{
  "success": false,
  "message": "No active check-in found for employee EMP-042 today."
}

Get Attendance for Employee

Retrieve all attendance records for a specific employee.

http
GET /api/v1/attendance/employee/{id}
Authorization: Bearer {token}

Path Parameters

ParameterDescription
idEmployee ID

Query Parameters

Same as the main List Attendance Records endpoint.

Response

Same structure as List Attendance Records, filtered to the specified employee.


Get Today's Attendance Status

Check whether a specific employee has checked in today.

http
GET /api/v1/attendance/today/{employee_id}
Authorization: Bearer {token}

Response — Checked In

json
{
  "success": true,
  "data": {
    "checked_in": true,
    "checked_out": false,
    "check_in": "08:55",
    "check_out": null,
    "status": "present",
    "total_hours_so_far": 4.5
  }
}

Response — Not Yet Checked In

json
{
  "success": true,
  "data": {
    "checked_in": false,
    "checked_out": false,
    "check_in": null,
    "check_out": null,
    "status": null
  }
}

Released under the MIT License.