So the documentation for the UpdateTimeEntryRequest (https://clockify.github.io/clockify_api_docs/#/definitions/UpdateTimeEntryRequest) is a bit wrong or incomplete. I figured it out through some testing, here's what you need to do:
First, you need to make sure you have the current data of the time entry, specifically the start date and billable status (as these are the only two "required" fields in the API call). You are getting the 400 bad request because you are missing these two fields - the error message is obviously no help here, but a 400 response code means "the server was unable to process the request sent by the client due to invalid syntax.", which makes sense, since your input is invalid.
Assuming you have the time entry information already (which is the only way I could see how you would know the ID), you could recreate the whole UpdateTimeEntryRequest data but then null out the end field or leave it out completely, like this:
{
"start": START_FROM_THE_TIME_ENTRY,
"billable": BILLABLE_FROM_THE_TIME_ENTRY,
"description": DESC_FROM_THE_TIME_ENTRY,
"projectId": PROJECT_ID,
"taskId": TASK_ID,
"end": null,
"tagIds": TAGS_ARRAY
}
From my testing, this restarts the timer. If you leave out any field, those fields are reset, for example:
{
"start": START_FROM_THE_TIME_ENTRY,
"billable": BILLABLE_FROM_THE_TIME_ENTRY
}
would restart the timer, but it would clear the description, project/task, and tags, which is probably not preferable.