Update an existing time booking
Updates an existing time booking entry. You can modify any field of the time booking.
Who can update time bookings:
- You can always update your own time bookings
- If you have the “editAnyTimeLog” permission, you can update any time booking in the workspace
- Otherwise, you cannot update time bookings created by other users
What can be updated: All fields are optional in the update request. Only provide the fields you want to change:
- Type: Change between task-based and project-based booking
- Task ID: Switch to a different task (if type is “task”)
- Project ID: Switch to a different project (if type is “project”)
- Activity ID: Change the activity type
- Hours: Adjust the logged hours
- Minutes: Adjust additional minutes (0-59)
- Comment: Update the comment text
- Date: Change the date when the work was performed
How it works:
- Fields not provided in the update request will keep their existing values
- If you change the type from “task” to “project” (or vice versa), make sure to provide the appropriate ID field
- Hours and minutes are combined: if you provide both, they are added together
- The system validates that the time booking exists and belongs to your workspace
Common use cases:
- Correcting a typo in hours or comment
- Moving time from one task to another
- Changing the activity type for better categorization
- Updating the date if it was logged incorrectly
PATCH
/timebookings/{id}Authorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredRequest body
requiredapplication/jsonactivityIdstringUUID of the activity type. Change this to recategorize the work type. If omitted, the existing activity is preserved. Use GET /administration/task-settings/activities.
commentstringComment text. Update this to change or add notes about the work performed. If omitted, the existing comment is preserved. To clear a comment, provide an empty string.
datestring<date>Date when the work was performed. Must be in ISO 8601 date format (YYYY-MM-DD). Use this to correct the date if the time was logged to the wrong day. If omitted, the existing date is preserved.
hoursnumberNumber of hours to update. Must be a positive number. Can be a decimal (e.g., 3.5 for 3 hours 30 minutes). If you also provide minutes, they will be added to this value. If omitted, the existing hours value is preserved.
idstringUUID of the task to link this time booking to. Required if type is "task". Use this to move time from one task to another, or to change from project-based to task-based booking. If omitted and type is not changed, the existing task link is preserved. Use GET /tasks/grid or GET /tasks/{identifier}.
minutesnumberAdditional minutes to add to the hours. Must be between 0 and 59. These minutes are converted and added to the hours value. If omitted, defaults to 0 (only the hours value is used).
projectIdstringUUID of the project to link this time booking to. Required if type is "project". Use this to move time from one project to another, or to change from task-based to project-based booking. If omitted and type is not changed, the existing project link is preserved. Use GET /projects.
typestringType of time booking. Change to "task" to link to a specific task, or "project" for project-only booking. If changing type, make sure to provide the corresponding ID field (id for task, projectId for project). If omitted, the existing type is preserved.
Allowed:
taskprojectResponses
200Time booking updated successfully
successboolean400Invalid request data
401Unauthorized - Invalid or missing authentication token
403Missing permission to edit this time booking
404Time booking not found
Request
curl -X PATCH "https://leadtime.app/api/public/timebookings/string" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"activityId": "550e8400-e29b-41d4-a716-446655440004",
"comment": "Updated comment",
"date": "2025-01-15",
"hours": 3,
"id": "550e8400-e29b-41d4-a716-446655440001",
"minutes": 0,
"projectId": "550e8400-e29b-41d4-a716-446655440002",
"type": "task"
}'const response = await fetch("https://leadtime.app/api/public/timebookings/string", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"activityId": "550e8400-e29b-41d4-a716-446655440004",
"comment": "Updated comment",
"date": "2025-01-15",
"hours": 3,
"id": "550e8400-e29b-41d4-a716-446655440001",
"minutes": 0,
"projectId": "550e8400-e29b-41d4-a716-446655440002",
"type": "task"
})
});import requests
response = requests.patch(
"https://leadtime.app/api/public/timebookings/string",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"activityId": "550e8400-e29b-41d4-a716-446655440004",
"comment": "Updated comment",
"date": "2025-01-15",
"hours": 3,
"id": "550e8400-e29b-41d4-a716-446655440001",
"minutes": 0,
"projectId": "550e8400-e29b-41d4-a716-446655440002",
"type": "task"
},
)Response
{
"success": true
}Invalid request data
Unauthorized - Invalid or missing authentication token
Missing permission to edit this time booking
Time booking not found