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 |
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
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries.json?
Response
Status: 200 OK
[
{
"id": "310252691193332746",
"administration_id": 123,
"contact_id": "310252691062260742",
"project_id": "310252691114689544",
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T11:00:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": true,
"created_at": "2021-01-08T10:00:44.894Z",
"updated_at": "2021-01-08T10:00:44.894Z",
"contact": {
"id": "310252691062260742",
"firstname": "",
"lastname": "",
"company_name": "Foobar Holding B.V."
},
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": {
"id": "310252691114689544",
"name": "My project name",
"state": "active"
},
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:44.907Z",
"updated_at": "2021-01-08T10:00:44.907Z"
}
],
"notes": [
]
},
{
"id": "310252691238421516",
"administration_id": 123,
"contact_id": null,
"project_id": null,
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T10:01:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": false,
"created_at": "2021-01-08T10:00:44.937Z",
"updated_at": "2021-01-08T10:00:44.937Z",
"contact": null,
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": null,
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:44.943Z",
"updated_at": "2021-01-08T10:00:44.943Z"
}
],
"notes": [
]
},
{
"id": "310252691290850318",
"administration_id": 123,
"contact_id": null,
"project_id": null,
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T10:01:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": true,
"created_at": "2021-01-08T10:00:44.987Z",
"updated_at": "2021-01-08T10:00:44.987Z",
"contact": null,
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": null,
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:44.993Z",
"updated_at": "2021-01-08T10:00:44.993Z"
}
],
"notes": [
]
}
]
Example: returns all time entries filtered on period
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries.json?filter=period%3Athis_month
Response
Status: 200 OK
[
{
"id": "310252691786826774",
"administration_id": 123,
"contact_id": "310252691694552082",
"project_id": "310252691741738004",
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T11:00:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": true,
"created_at": "2021-01-08T10:00:45.459Z",
"updated_at": "2021-01-08T10:00:45.459Z",
"contact": {
"id": "310252691694552082",
"firstname": "",
"lastname": "",
"company_name": "Foobar Holding B.V."
},
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": {
"id": "310252691741738004",
"name": "My project name",
"state": "active"
},
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:45.466Z",
"updated_at": "2021-01-08T10:00:45.466Z"
}
],
"notes": [
]
},
{
"id": "310252691825624088",
"administration_id": 123,
"contact_id": null,
"project_id": null,
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T10:01:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": false,
"created_at": "2021-01-08T10:00:45.495Z",
"updated_at": "2021-01-08T10:00:45.495Z",
"contact": null,
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": null,
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:45.502Z",
"updated_at": "2021-01-08T10:00:45.502Z"
}
],
"notes": [
]
},
{
"id": "310252691867567130",
"administration_id": 123,
"contact_id": null,
"project_id": null,
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T10:01:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": true,
"created_at": "2021-01-08T10:00:45.536Z",
"updated_at": "2021-01-08T10:00:45.536Z",
"contact": null,
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": null,
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:45.542Z",
"updated_at": "2021-01-08T10:00:45.542Z"
}
],
"notes": [
]
}
]
Example: returns all time entries filtered on search query
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries.json?query=Custom
Response
Status: 200 OK
[
{
"id": "310252696974132266",
"administration_id": 123,
"contact_id": null,
"project_id": null,
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T10:01:00.000Z",
"description": "Custom description",
"paused_duration": 0,
"billable": true,
"created_at": "2021-01-08T10:00:50.400Z",
"updated_at": "2021-01-08T10:00:50.400Z",
"contact": null,
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": null,
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:50.408Z",
"updated_at": "2021-01-08T10:00:50.408Z"
}
],
"notes": [
]
}
]
Example: returns all time entries filtered on state
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries.json?filter=state%3Anon_billable
Response
Status: 200 OK
[
{
"id": "310252697451234356",
"administration_id": 123,
"contact_id": null,
"project_id": null,
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T10:01:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": false,
"created_at": "2021-01-08T10:00:50.854Z",
"updated_at": "2021-01-08T10:00:50.854Z",
"contact": null,
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": null,
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:50.862Z",
"updated_at": "2021-01-08T10:00:50.862Z"
}
],
"notes": [
]
}
]
Example: returns paginated time entries on page 1
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries.json?per_page=1
Response
Status: 200 OK
[
{
"id": "310252697848644670",
"administration_id": 123,
"contact_id": "310252697735398458",
"project_id": "310252697793070140",
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T11:00:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": true,
"created_at": "2021-01-08T10:00:51.231Z",
"updated_at": "2021-01-08T10:00:51.231Z",
"contact": {
"id": "310252697735398458",
"firstname": "",
"lastname": "",
"company_name": "Foobar Holding B.V."
},
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": {
"id": "310252697793070140",
"name": "My project name",
"state": "active"
},
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:51.242Z",
"updated_at": "2021-01-08T10:00:51.242Z"
}
],
"notes": [
]
}
]
Example: returns paginated time entries on page 2
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries.json?page=2&per_page=1
Response
Status: 200 OK
[
{
"id": "310252698324698188",
"administration_id": 123,
"contact_id": null,
"project_id": null,
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T10:01:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": false,
"created_at": "2021-01-08T10:00:51.687Z",
"updated_at": "2021-01-08T10:00:51.687Z",
"contact": null,
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": null,
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:51.692Z",
"updated_at": "2021-01-08T10:00:51.692Z"
}
],
"notes": [
]
}
]
Example: returns an error when too many time entries are requested
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries.json?per_page=101
Response
Status: 400 Bad Request
{
"error": "Per Page is too big",
"symbolic": {
"per_page": "max"
}
}
Example: returns an error message if filter contact_id is not found
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries.json?filter=contact_id%3A123
Response
Status: 404 Not Found
{
"error": "record not found",
"symbolic": {
"contact_id": "not_found"
}
}
Example: returns an error message if filter user_id is not found
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries.json?filter=user_id%3A123
Response
Status: 404 Not Found
{
"error": "record not found",
"symbolic": {
"user_id": "not_found"
}
}
Get a time entry by id
Returns a time entry in the administration.
Example: returns time entry by given id
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries/310252699752858746.json?
Response
Status: 200 OK
{
"id": "310252699752858746",
"administration_id": 123,
"contact_id": "310252699655341174",
"project_id": "310252699703575672",
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T11:00:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": true,
"created_at": "2021-01-08T10:00:53.047Z",
"updated_at": "2021-01-08T10:00:53.047Z",
"contact": {
"id": "310252699655341174",
"firstname": "",
"lastname": "",
"company_name": "Foobar Holding B.V."
},
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": {
"id": "310252699703575672",
"name": "My project name",
"state": "active"
},
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:53.054Z",
"updated_at": "2021-01-08T10:00:53.054Z"
}
],
"notes": [
]
}
Example: returns 404 when time entry does not exist
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XGET \
https://moneybird.com/api/v2/123/time_entries/34123123.json?
Response
Status: 404 Not Found
{
"error": "record not found",
"symbolic": {
"id": "not_found"
}
}
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. |
user_agent |
String |
Example: create a basic time entry
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPOST \
-d '{"time_entry":{"started_at":"2021-01-08 10:00:00 UTC","ended_at":"2021-01-08 11:00:00 UTC","description":"Test","contact_id":310252700248835206,"project_id":310252700282389640,"user_id":16100997019402,"billable":false}}' \
https://moneybird.com/api/v2/123/time_entries
Response
Status: 201 Created
{
"id": "310252700402975882",
"administration_id": 123,
"contact_id": "310252700248835206",
"project_id": "310252700282389640",
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T11:00:00.000Z",
"description": "Test",
"paused_duration": 0,
"billable": false,
"created_at": "2021-01-08T10:00:53.667Z",
"updated_at": "2021-01-08T10:00:53.667Z",
"contact": {
"id": "310252700248835206",
"firstname": "",
"lastname": "",
"company_name": "Foobar Holding B.V."
},
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": {
"id": "310252700282389640",
"name": "My project name",
"state": "active"
},
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:53.672Z",
"updated_at": "2021-01-08T10:00:53.672Z"
}
],
"notes": [
]
}
Example: returns an error when invalid details are provided
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPOST \
-d '{"time_entry":{"started_at":"2021-01-08 10:00:00 UTC","ended_at":"2021-01-08 09:00:00 UTC","user_id":16100997019402,"billable":false}}' \
https://moneybird.com/api/v2/123/time_entries
Response
Status: 422 Unprocessable Entity
{
"error": {
"ended_at": [
"cannot be before the start time"
],
"description": [
"cannot be empty"
]
}
}
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
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPATCH \
-d '{"time_entry":{"description":"Updated description"}}' \
https://moneybird.com/api/v2/123/time_entries/310252700776268946
Response
Status: 200 OK
{
"id": "310252700776268946",
"administration_id": 123,
"contact_id": null,
"project_id": "310252700729083024",
"user_id": 16100997019402,
"started_at": "2021-01-08T10:00:00.000Z",
"ended_at": "2021-01-08T11:00:00.000Z",
"description": "Updated description",
"paused_duration": 0,
"billable": true,
"created_at": "2021-01-08T10:00:54.022Z",
"updated_at": "2021-01-08T10:00:54.140Z",
"contact": null,
"detail": null,
"user": {
"id": 16100997019402,
"name": "Moneybird",
"created_at": "2021-01-08T09:55:01.315Z",
"updated_at": "2021-01-08T09:55:01.973Z"
},
"project": {
"id": "310252700729083024",
"name": "My project name",
"state": "active"
},
"events": [
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_created",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:54.028Z",
"updated_at": "2021-01-08T10:00:54.028Z"
},
{
"administration_id": 123,
"user_id": 16100997019402,
"action": "time_entry_updated",
"link_entity_id": null,
"link_entity_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:54.145Z",
"updated_at": "2021-01-08T10:00:54.145Z"
}
],
"notes": [
]
}
Delete a time entry
Example: deletes given time entry
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XDELETE \
-d '{}' \
https://moneybird.com/api/v2/123/time_entries/310252701103424667.json
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. |
Example: create a note
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPOST \
-d '{"note":{"note":"Text of the note","assignee_id":16101000549089,"todo":true}}' \
https://moneybird.com/api/v2/123/time_entries/310252701415900325/notes.json
Response
Status: 201 Created
{
"id": "310252701526000807",
"administration_id": 123,
"entity_id": "310252701415900325",
"entity_type": "TimeEntry",
"user_id": 16100997019402,
"assignee_id": 16101000549089,
"todo": true,
"note": "Text of the note",
"completed_at": null,
"completed_by_id": null,
"todo_type": null,
"data": {
},
"created_at": "2021-01-08T10:00:54.734Z",
"updated_at": "2021-01-08T10:00:54.734Z"
}
Destroys note from entity
Example: destroy a note
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XDELETE \
-d '{}' \
https://moneybird.com/api/v2/123/time_entries/310252701748298927/notes/310252701793387697.json