post https://api.timeero.app/api/public/timesheets
Endpoint: POST /timesheets
Description: Create a new timesheet. All fields are optional and can be provided as needed except user_id and start.
Note: A list of valid timezones to be used in API requests can be found here: Timezones. Please note that when using ISO 8601 date/time values with an offset, the offset must match the provided timezone. If no timezone is provided, it will default to the company's timezone.
Request Body:
Parameter | Type | Description |
---|---|---|
user_id required | integer | The ID of the user. |
start required | datetime | Start time of the timesheet in ISO 8601 format: YYYY-MM-DDTHH:MM:SS±HH:MM. |
end optional | datetime | End time of the timesheet in ISO 8601 format: YYYY-MM-DDTHH:MM:SS±HH:MM |
job_id optional | integer | The ID of the job. |
task_id optional | integer | The ID of the task. |
clock_in_timezone optional | string | The timezone at clock in. The company's timezone will be used if none is provided. And it must match the offset when ISO 8601 offset is set. |
clock_out_timezone optional | string | The timezone at clock out. The company's timezone will be used if none is provided. And it must match the ISO 8601 offset when set. |
notes optional | string | A description |
mileage optional | double/float | Distance covered in miles |
Request Body Sample:
{
"user_id": 1,
"job_id": 5102,
"mileage": 10,
"notes": "",
"start": "2024-10-24T08:10:48+07:00",
"end": null,
"clock_in_timezone": "America/Los_Angeles",
"clock_out_timezone":null
}
Where user_id and start are required
All the other fields are optional.