Update existing time tracker
Updates metadata of an existing time tracker. You can modify any of the following fields:
- timeTrackingType: Change between Task and Project tracking
- projectId: Change or remove project association
- taskId: Change or remove task association
- activityId: Change or remove activity category
- comment: Update or remove the comment
- correction: Adjust tracked time in minutes (positive to add time, negative to subtract)
All fields are optional - only provided fields will be updated. The tracker must belong to the authenticated user.
Note: This does not affect the tracker intervals or running status. Use pause/resume endpoints to control time tracking.
PATCH
/account/time-tracker/{id}Authorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredQuery 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/jsonactivityIdobject | nullOptional. Update or remove the activity category. Provide a UUID to change the activity, or null to remove it.
commentobject | nullOptional. Update or remove the comment. Provide a string to update the comment, or null to remove it.
correctionnumberOptional. Adjust the tracked time by providing a correction in minutes. Positive values add time, negative values subtract time. This affects the total hours calculation.
projectIdobject | nullOptional. Update or remove the project association. Provide a UUID to change the project, or null to remove the association. Only provided fields are updated.
taskIdobject | nullOptional. Update or remove the task association. Provide a UUID to change the task, or null to remove the association. Only used when timeTrackingType is Task.
timeTrackingTypestringOptional. Change the time tracking type between Task and Project. If changed, ensure taskId is appropriate for the new type.
Allowed:
TaskProjectResponses
200
activityIdobject | nullrequiredUUID of the activity category (e.g., Development, Testing, Management). Used for categorizing work in reports. Can be null.
autoEndedbooleanrequiredWhether any interval was automatically ended at the end of the day. This happens when a running interval started on a previous day and was not manually stopped.
commentobject | nullrequiredOptional comment or description of the work being tracked. Helps provide context when reviewing time entries later.
correctionnumberrequiredManual time adjustment in minutes. Positive values add time, negative values subtract time. Useful for correcting tracking errors or adding time that was not tracked. Default is 0.
createdAtstringrequiredTimestamp when the tracker was created, in ISO 8601 format (UTC)
hoursnumberrequiredTotal tracked time in hours, calculated from all intervals plus any correction. Minimum value is 0.0166667 (1 minute).
hoursPaddedstringrequiredHours portion of the tracked time, formatted as a zero-padded string (e.g., "02", "12", "00")
idstringrequiredUnique identifier for the time tracker (UUID)
intervalsTimeTrackerIntervalDto[]requiredArray of time intervals that make up the total tracked time. Each interval represents a continuous period of tracking (start to end). If an interval has no end, it is currently active. Intervals are automatically ended at end of day if they span midnight.
Show propertiesHide properties
Array of
TimeTrackerIntervalDtoendstringrequiredInterval end time in ISO 8601 format (UTC). For active (running) intervals, this is set to the current time. For completed intervals, this marks when tracking stopped. Intervals that span midnight are automatically ended at end of day.
startstringrequiredInterval start time in ISO 8601 format (UTC). This is when the time tracking period began.
isOldbooleanrequiredWhether the tracker contains intervals from previous days. True if any interval start time is not from today.
isRunningbooleanrequiredWhether the tracker currently has an active (running) interval. True if any interval has no end time, meaning time is being tracked right now.
minutesPaddedstringrequiredMinutes portion of the tracked time, formatted as a zero-padded string (e.g., "05", "30", "59")
projectIdobject | nullrequiredUUID of the project this tracker is associated with. Can be null if tracking general work.
taskIdobject | nullrequiredUUID of the task this tracker is associated with. Only used when timeTrackingType is Task. Can be null for project-level tracking.
timeTrackingTypestringrequiredType of time tracking: Task (tracking time on a specific task) or Project (tracking time at project level). Determines whether taskId is required.
Allowed:
TaskProject400Invalid input data
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
404Tracker not found or does not belong to user
Request
curl -X PATCH "https://leadtime.app/api/public/account/time-tracker/string" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"activityId": "550e8400-e29b-41d4-a716-446655440003",
"comment": "Updated comment",
"correction": 5,
"projectId": "550e8400-e29b-41d4-a716-446655440001",
"taskId": "550e8400-e29b-41d4-a716-446655440002",
"timeTrackingType": "Task"
}'const response = await fetch("https://leadtime.app/api/public/account/time-tracker/string", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"activityId": "550e8400-e29b-41d4-a716-446655440003",
"comment": "Updated comment",
"correction": 5,
"projectId": "550e8400-e29b-41d4-a716-446655440001",
"taskId": "550e8400-e29b-41d4-a716-446655440002",
"timeTrackingType": "Task"
})
});import requests
response = requests.patch(
"https://leadtime.app/api/public/account/time-tracker/string",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"activityId": "550e8400-e29b-41d4-a716-446655440003",
"comment": "Updated comment",
"correction": 5,
"projectId": "550e8400-e29b-41d4-a716-446655440001",
"taskId": "550e8400-e29b-41d4-a716-446655440002",
"timeTrackingType": "Task"
},
)Response
{
"activityId": "550e8400-e29b-41d4-a716-446655440003",
"autoEnded": false,
"comment": "Working on feature implementation",
"correction": 0,
"createdAt": "2024-01-15T10:00:00Z",
"hours": 2.5,
"hoursPadded": "02",
"id": "550e8400-e29b-41d4-a716-446655440000",
"intervals": [
{
"end": "2024-01-15T11:30:00Z",
"start": "2024-01-15T10:00:00Z"
}
],
"isOld": false,
"isRunning": true,
"minutesPadded": "30",
"projectId": "550e8400-e29b-41d4-a716-446655440001",
"taskId": "550e8400-e29b-41d4-a716-446655440002",
"timeTrackingType": "Task"
}Invalid input data
Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions
Tracker not found or does not belong to user