- DATE:
- AUTHOR:
- The Toast - API team
New parameter includes deleted time entries in labor API request
You can use the new includeArchived
query parameter for the labor API /timeEntries
endpoint to get information about deleted (archived) time entries. The includeArchived
parameter controls whether the endpoint response includes deleted time entries, when using the startDate
and endDate
parameters.
Important
The includeArchived
parameter has no effect if you use the modifiedStartDate
and modifiedEndDate
parameters or the businessDate
parameter to select time entries.
Querying by a date and time range using the
startDate
andendDate
parameters of the/timeEntries
endpoint returns deleted time entries if you include theincludeArchived
parameter and set it totrue
. TheincludeArchived
parameter is optional and its default value isfalse
.Querying by modified date range using the the
modifiedStartDate
andmodifiedEndDate
parameters of the/timeEntries
endpoint always returns deleted time entries.Querying by business date using the
businessDate
parameter of the/timeEntries
endpoint never returns deleted time entries.
You can identify deleted time entries in the response data for the /timeEntries
endpoint by checking the deleted
and deletedDate
values of a TimeEntry
object. If the deleted
value is true
and the deletedDate
is not null
, the time entry is deleted. The following example shows a TimeEntry
object for a deleted time entry.
TimeEntry object for a deleted time entry
{
"guid": "e3c23dd7-7e01-4388-b6a4-65efa53d4ccf",
"entityType": "TimeEntry",
[contents omitted]
"deleted": true,
"deletedDate": "2023-05-23T23:42:53.671+0000",
[contents omitted]
}