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
/attendanceAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredQuery parameters
fieldsToReturnstringComma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestringAdvanced 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:
compactfullHeader parameters
LT-Response-ShapestringAdvanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:
fullRequest body
requiredapplication/jsoncommentstringOptional notes or comments about the workday. Can include information about the work performed, special circumstances, or any relevant details.
datestringrequiredDate of the workday in ISO 8601 format (YYYY-MM-DD). This is the date for which attendance is being recorded.
moodstringrequiredEmployee mood for the workday. Indicates how the employee felt during the day: Good (positive), Neutral (normal), or Bad (challenging).
Allowed:
GoodNeutralBadtimeFromstringrequiredClock-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]$
timeTostringClock-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 | nullrequiredOptional notes or comments about the workday. Can include information about work performed or special circumstances.
datestringrequiredDate of the attendance record
deletedAtstring | nullrequiredDeletion timestamp (null if not deleted)
moodstring | nullrequiredEmployee mood for the workday (Good, Neutral, or Bad). Indicates how the employee felt during the day.
Allowed:
GoodNeutralBadtimeFromstring | nullrequiredClock-in time (when work started). ISO 8601 datetime format. Null if not yet clocked in.
timeTostring | nullrequiredClock-out time (when work ended). ISO 8601 datetime format. Null if not yet clocked out.
totalHoursnumber | nullrequiredTotal hours worked, automatically calculated from clock-in and clock-out times. Null if end time is not yet recorded.
typestringrequiredType of attendance record. Indicates the nature of the workday (e.g., Workday, Holiday, etc.).
Allowed:
WorkdayVacationVacationPendingSickAway400Validation errors
errorsobjectShow propertiesHide properties
datestring[]globalErrorsstring[]moodstring[]timeFromstring[]messagestringstatusCodenumber401Unauthorized - Invalid or missing authentication token
403Not an employee or attendance not enabled in workspace
messagestringstatusCodenumberRequest
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"
}'const response = await fetch("https://leadtime.app/api/public/attendance", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"comment": "Regular workday",
"date": "2025-01-15",
"mood": "Good",
"timeFrom": "09:00",
"timeTo": "17:30"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/attendance",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"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"
}{
"errors": {
"date": [
"Date is required."
],
"globalErrors": [
"Attendance overlaps with vacation or sickness period."
],
"mood": [
"Mood is required."
],
"timeFrom": [
"Time from is required."
]
},
"message": "Bad Request",
"statusCode": 400
}Unauthorized - Invalid or missing authentication token
{
"message": "Forbidden",
"statusCode": 403
}