Skip to main content

Time Entries

Information pertaining to retrieving, creating, editing, and deleting time entries.

Link to documentation

List all time entries

Returns a list of your time entries. The time entries are returned sorted by spent_at date. At this time, the sort option can’t be customized.

The response contains an object with a time_entries property that contains an array of up to per_page time entries. Each entry in the array is a separate time entry object. If no more time entries are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your time entries.

Link to documentation

hrvst time-entries list
OptionDescriptionRequired
--user_idOnly return time entries belonging to the user with the given ID.false
--client_idOnly return time entries belonging to the client with the given ID.false
--task_idOnly return time entries belonging to the task with the given ID.false
--external_reference_idOnly return time entries with the given external_reference ID.false
--is_billedPass true to only return time entries that have been invoiced and false to return time entries that have not been invoiced.false
--is_runningPass true to only return running time entries and false to return non-running time entries.false
--updated_sinceOnly return time entries that have been updated since the given date and time.false
--fromOnly return time entries with a spent_date on or after the given date.false
--toOnly return time entries with a spent_date on or before the given date.false
--pageThe page number to use in pagination. Use all to retrieve all pages.false
--per_pageThe number of records to return per page. Can range between 1 and 100. (Default: 100)false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Retrieve a specific time entry

Retrieves the time entry with the given ID. Returns a time entry object and a 200 OK response code if a valid identifier was provided.

Link to documentation

hrvst time-entries get
OptionDescriptionRequired
--time_entry_idThe ID of the time entry you're retrieving.true
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Create a time entry via duration

Creates a new time entry object. Returns a time entry object and a 201 Created response code if the call succeeded.

You should only use this method to create time entries when your account is configured to track time via duration. You can verify this by visiting the Settings page in your Harvest account or by checking if wants_timestamp_timers is false in the Company API.

Link to documentation

hrvst time-entries create
OptionDescriptionRequired
--project_idThe ID of the project to associate with the time entry.true
--task_idThe ID of the task to associate with the time entry.true
--spent_dateThe ISO 8601 formatted date on which the time entry was spent.true
--user_idThe ID of the user to associate with the time entry. Defaults to the currently authenticated user’s ID.false
--hoursThe current amount of time tracked. If provided, the time entry will be created with the specified hours and is_running will be set to false. If not provided, hours will be set to 0.0 and is_running will be set to true.false
--notesAny notes to be associated with the time entry.false
--external_reference[id]The ID of the service's equivalent of a task, card, etc.false
--external_reference[group_id]The ID of the service's equivalent of a project, board, etc.false
--external_reference[permalink]The URL of where the time is being tracked.false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Create a time entry via start and end time

Creates a new time entry object. Returns a time entry object and a 201 Created response code if the call succeeded.

You should only use this method to create time entries when your account is configured to track time via start and end time. You can verify this by visiting the Settings page in your Harvest account or by checking if wants_timestamp_timers is true in the Company API.

Link to documentation

hrvst time-entries create
OptionDescriptionRequired
--project_idThe ID of the project to associate with the time entry.true
--task_idThe ID of the task to associate with the time entry.true
--spent_dateThe ISO 8601 formatted date the time entry was spent.true
--user_idThe ID of the user to associate with the time entry. Defaults to the currently authenticated user’s ID.false
--started_timeThe time the entry started. Defaults to the current time. Example: “8:00am”.true
--ended_timeThe time the entry ended. If provided, is_running will be set to false. If not provided, is_running will be set to true.true
--notesAny notes to be associated with the time entry.false
--external_reference[id]The ID of the service's equivalent of a task, card, etc.false
--external_reference[group_id]The ID of the service's equivalent of a project, board, etc.false
--external_reference[permalink]The URL of where the time is being tracked.false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Restart a stopped time entry

Restarting a time entry is only possible if it isn’t currently running. Returns a 200 OK response code if the call succeeded.

Link to documentation

hrvst time-entries restart
OptionDescriptionRequired
--time_entry_idThe ID of the time entry you're restarting.true
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Stop a running time entry

Stopping a time entry is only possible if it’s currently running. Returns a 200 OK response code if the call succeeded.

Link to documentation

hrvst time-entries stop
OptionDescriptionRequired
--time_entry_idThe ID of the time entry you're stopping.true
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Update a time entry

Updates the specific time entry by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a time entry object and a 200 OK response code if the call succeeded.

Link to documentation

hrvst time-entries update
OptionDescriptionRequired
--time_entry_idThe ID of the time entry you're updating.true
--project_idThe ID of the project to associate with the time entry.false
--task_idThe ID of the task to associate with the time entry.false
--spent_dateThe ISO 8601 formatted date the time entry was spent.false
--started_timeThe time the entry started. Defaults to the current time. Example: “8:00am”.false
--ended_timeThe time the entry ended.false
--hoursThe current amount of time tracked.false
--notesAny notes to be associated with the time entry.false
--external_reference[id]The ID of the service's equivalent of a task, card, etc.false
--external_reference[group_id]The ID of the service's equivalent of a project, board, etc.false
--external_reference[permalink]The URL of where the time is being tracked.false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Delete a time entry

Delete a time entry. Deleting a time entry is only possible if it’s not closed and the associated project and task haven’t been archived. However, Admins can delete closed entries. Returns a 200 OK response code if the call succeeded.

Link to documentation

hrvst time-entries delete
OptionDescriptionRequired
--time_entry_idThe ID of the time entry you're deleting.true
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Delete a time entry's external reference.

Delete a time entry’s external reference. Returns a 200 OK response code if the call succeeded.

Link to documentation

hrvst time-entries delete-external-reference
OptionDescriptionRequired
--time_entry_idThe ID of the time entry whose external reference you're deleting.true
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse