Time entries
List all time entries
Returns a paginated list of all time entries in the administration.
The filter
argument allows you to filter the list of time entries. Filters are a combination of keys and values,
separated by a comma: period:this_year,state:all
. The available options for filtering are:
Filter | Type | Default | Description |
state | String |
all |
all , open or non_billable |
period | String |
this_year |
This can either be the description of a period (this_month , prev_month , next_month , this_quarter , prev_quarter , next_quarter , this_year , prev_year , next_year ) or a custom period (201301..201302 , 20130101..20130131 ) |
contact_id | Integer |
Select time entries belonging to a certain contact | |
include_nil_contacts | Boolean |
false | Whether to include time entries that have no assigned contact |
include_active | Boolean |
false | Whether to include active time entries i.e. time entries without ended_at |
project_id | Integer |
Select time entries belonging to a certain project | |
user_id | Integer |
Select time entries belonging to a certain user | |
day | Date |
Select time entries on a specific date |
You can filter by multiple states at the same time as well. To do this, separate the state values by a pipe: state:open|non_billable
.
Parameters
Parameter | Type | Description |
---|---|---|
filter |
String |
|
query |
String |
Allows filtering by time entry description. |
Example: returns all time entries of an administration
Request
Response
Example: returns all time entries filtered on period
Request
Response
Example: returns all time entries filtered on search query
Request
Response
Example: returns all time entries filtered on state
Request
Response
Example: returns paginated time entries on page 1
Request
Response
Example: returns paginated time entries on page 2
Request
Response
Example: returns an error when too many time entries are requested
Request
Response
Example: returns an error message if filter contact_id is not found
Request
Response
Example: returns an error message if filter user_id is not found
Request
Response
Get a time entry by id
Returns a time entry in the administration.
Example: returns time entry by given id
Request
Response
Example: returns 404 when time entry does not exist
Request
Response
Create a time entry
Api user needs access to both sales invoices and time entries for this action.
started_at
and ended_at
are rounded down to full minutes when creating a time entry, with a minimum of 1 minute between them.
Parameters
Parameter | Type | Description |
---|---|---|
time_entry[user_id] |
Integer |
Required Should be a valid user id. |
time_entry[started_at] |
Datetime |
Required |
time_entry[ended_at] |
Datetime |
Required. |
time_entry[description] |
String |
Required |
time_entry[contact_id] |
Integer |
Should be a valid contact id. |
time_entry[project_id] |
Integer |
Should be a valid project id. |
time_entry[detail_id] |
Integer |
Should be a valid detail id. |
time_entry[billable] |
Boolean |
|
time_entry[paused_duration] |
Integer |
Total paused duration in seconds, is rounded down to full minutes. |
Example: create a basic time entry
Request
Response
Example: returns an error when invalid details are provided
Request
Response
Update a time entry
When updating a time entry, provide only the attributes you want to update. The other attributes will not be changed.
started_at
and ended_at
are rounded down to full minutes when updating a time entry, with a minimum of 1 minute between them.
Parameters
Parameter | Type | Description |
---|---|---|
time_entry[started_at] |
Datetime |
|
time_entry[ended_at] |
Datetime |
Required. |
time_entry[paused_duration] |
Integer |
Total paused duration in seconds, is rounded down to full minutes. |
time_entry[contact_id] |
Integer |
Should be a valid contact id. |
time_entry[project_id] |
Integer |
Should be a valid project id. |
time_entry[description] |
String |
|
time_entry[billable] |
Boolean |
Example: updating the time entry description
Request
Response
Delete a time entry
Example: deletes given time entry
Request
Response
Adds note to entity
Parameters
Parameter | Type | Description |
---|---|---|
note[note] |
String |
Required. Text for the note or to-do. |
note[todo] |
Boolean |
If |
note[assignee_id] |
Integer |
Assign to-do to user. Should be a valid user id. If assignee_id is provided the note will be a to-do. |