Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

Create or update attendance record

Creates a new attendance record or updates an existing one for the current employee.

What is Attendance Tracking? Attendance tracking records when employees clock in and clock out (check in/check out). It captures the start and end times of work periods, allowing the system to:

  • Calculate total hours worked
  • Track presence and absence
  • Monitor team availability
  • Integrate with time tracking and overtime calculations

What can be recorded:

  • Date: The work date
  • Start time (timeFrom): When the employee clocked in (required, format: HH)
  • End time (timeTo): When the employee clocked out (optional, format: HH)
  • Mood: Employee mood for the day (Good, Neutral, Bad)
  • Comment: Optional notes about the workday

How it works:

  • If an attendance record already exists for the date, it will be updated
  • If no record exists, a new one will be created
  • Total hours are automatically calculated from start and end times
  • The system validates that attendance doesn’t overlap with vacation or sick days

Note: This endpoint is only available for employee accounts. Attendance tracking must be enabled in the workspace settings.

POST/attendance
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Query parameters
fieldsToReturnstring
Comma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestring
Advanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:compactfull
Header parameters
LT-Response-Shapestring
Advanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:full
Request body
requiredapplication/json
commentstring
Optional notes or comments about the workday. Can include information about the work performed, special circumstances, or any relevant details.
datestringrequired
Date of the workday in ISO 8601 format (YYYY-MM-DD). This is the date for which attendance is being recorded.
moodstringrequired
Employee mood for the workday. Indicates how the employee felt during the day: Good (positive), Neutral (normal), or Bad (challenging).
Allowed:GoodNeutralBad
timeFromstringrequired
Clock-in time (start of work) in HH:mm format (24-hour format). This is when the employee started working. Example: "09:00" for 9 AM, "13:30" for 1:30 PM.
matches ^([0-1][0-9]|2[0-3]):[0-5][0-9]$
timeTostring
Clock-out time (end of work) in HH:mm format (24-hour format). Optional - if not provided, you can clock out later. Must be after timeFrom if provided. Example: "17:30" for 5:30 PM.
matches ^([0-1][0-9]|2[0-3]):[0-5][0-9]$
Responses
200Attendance record created or updated successfully
commentstring | nullrequired
Optional notes or comments about the workday. Can include information about work performed or special circumstances.
datestringrequired
Date of the attendance record
deletedAtstring | nullrequired
Deletion timestamp (null if not deleted)
moodstring | nullrequired
Employee mood for the workday (Good, Neutral, or Bad). Indicates how the employee felt during the day.
Allowed:GoodNeutralBad
timeFromstring | nullrequired
Clock-in time (when work started). ISO 8601 datetime format. Null if not yet clocked in.
timeTostring | nullrequired
Clock-out time (when work ended). ISO 8601 datetime format. Null if not yet clocked out.
totalHoursnumber | nullrequired
Total hours worked, automatically calculated from clock-in and clock-out times. Null if end time is not yet recorded.
typestringrequired
Type of attendance record. Indicates the nature of the workday (e.g., Workday, Holiday, etc.).
Allowed:WorkdayVacationVacationPendingSickAway
400Validation errors
errorsobject
Show properties
datestring[]
globalErrorsstring[]
moodstring[]
timeFromstring[]
messagestring
statusCodenumber
401Unauthorized - Invalid or missing authentication token
403Not an employee or attendance not enabled in workspace
messagestring
statusCodenumber
Request
curl -X POST "https://leadtime.app/api/public/attendance" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "comment": "Regular workday",
  "date": "2025-01-15",
  "mood": "Good",
  "timeFrom": "09:00",
  "timeTo": "17:30"
}'
Response
{
  "comment": "Regular workday",
  "date": "2025-01-15T00:00:00.000Z",
  "deletedAt": null,
  "mood": "Good",
  "timeFrom": "1970-01-01T09:00:00.000Z",
  "timeTo": "1970-01-01T17:30:00.000Z",
  "totalHours": 8.5,
  "type": "Workday"
}