× FreshBooks App Logo
FreshBooks
Official App
Free - Google Play
Get it
You're currently on our US site. Select your regional site here:

Time Entries

Time Entries represent time spent working for a client or project.

Access Requirements

AccessRequires Authorization
Scopesuser:time_entries:read
user:time_entries:write

Important Note

When using GET calls for Projects and Time Tracking, please leave out the Content Type from your header.

Includes

There are no includes for time entries.

Filters

Filter TypeNameDescription
Boolbillabletrue returns entries that can be automatically added to an invoice
Boolbilledtrue returns entries that have already been added to an invoice
Equalsclient_idmatches exact client id
Boolinclude_deletedtrue returns deleted time entries
Boolteamtrue returns entries logged by all members of the business
Boolinclude_unloggedtrue returns entries currently in progress for a running timer
Datetimestarted_frommatches entries that take place at or after the specified UTC date/time
Datetimestarted_tomatches entries that take place before or at the specified UTC date/time
Datetimeupdated_sincematches entries that have been updated at or after the specified UTC date/time
Equalsidentity_idmatches entries logged against a specific teammate or user


Field Descriptions

underlined fields are required on creation

FieldTypeDescription
billableboolTrue for entries that can be automatically added to an invoice
billedboolTrue for entries that have already been added to an invoice or manually marked as billed
client_idintThe unique identifier of the client to be billed for this entry
durationintThe length of time in seconds
internalboolTrue if the time entry is not assigned to a client
is_loggedboolFalse if the time entry is being created from a running timer
notestringA short description of the work being done during the time
project_idintThe unique identifier of the project worked on during the time
service_idintThe unique identifier of the project service worked on during the time
started_atintThe date/time in UTC when the work started
identity_idintThe unique identifier of the teammate or user logging the time entry

 

Get A Single Time Entry

Request:

GET "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries/5095"

Response:


{
    "time_entry": {
        "note": "Things",
        "duration": 30,
        "project_id": 153125,
        "client_id": 2227125,
        "is_logged": true,
        "started_at": "2016-08-16T18:03:28Z",
        "active": true,
        "id": 5095,
        "timer": {
            "id": 2936,
            "is_running": false
        }
    }
}

List Time Entries

Request:

GET "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries"

Response:


{
    "time_entries": [
        {
            "note": "Things",
            "duration": 30,
            "project_id": 153125,
            "client_id": 2227125,
            "is_logged": true,
            "started_at": "2016-08-16T18:03:28Z",
            "active": true,
            "id": 5095,
            "timer": {
                "id": 2936,
                "is_running": false
            }
        }
    ],
    "meta": {
        "pages": 1,
        "total_logged": 30,
        "total_unbilled": 30,
        "per_page": 15,
        "total": 1,
        "page": 1
    }
}

List Time Entries From A Specific Day

Request:

GET "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries?started_from=2016-08-17T00:00:00Z&started_to=2016-08-18T00:00:00Z"

Response:


{
  "time_entries": [
      {
          "note": "Things",
          "duration": 30,
          "project_id": 153125,
          "client_id": 2227125,
          "is_logged": true,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5095,
          "timer": {
              "id": 2936,
              "is_running": false
          }
      }
  ],
  "meta": {
      "pages": 1,
      "total_logged": 30,
      "total_unbilled": 30,
      "per_page": 4,
      "total": 1,
      "page": 1
  }
}

List Time Entries Update From A Particular Time

Request:

GET "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries?updated_since=2016-08-01T03:00:00Z&include_deleted=1"


{
  "time_entries": [
      {
          "note": null,
          "duration": null,
          "project_id": 153125,
          "client_id": 2149780,
          "is_logged": false,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5097,
          "timer": {
              "id": 2938,
              "is_running": true
          }
      },
      {
          "note": null,
          "duration": null,
          "project_id": null,
          "client_id": 2149780,
          "is_logged": false,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5098,
          "timer": {
              "id": 2939,
              "is_running": true
          }
      },
      {
          "note": null,
          "duration": null,
          "project_id": null,
          "client_id": 2149780,
          "is_logged": false,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5096,
          "timer": {
              "id": 2937,
              "is_running": true
          }
      },
      {
          "note": "Things",
          "duration": 30,
          "project_id": 153125,
          "client_id": 2227125,
          "is_logged": true,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5095,
          "timer": {
              "id": 2936,
              "is_running": false
          }
      }
  ],
  "meta": {
      "pages": 1,
      "total_logged": 30,
      "total_unbilled": 30,
      "per_page": 4,
      "total": 4,
      "page": 1
  }
}

Create a Time Entry

Request:

POST "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries"


{
    "time_entry": {
        "is_logged": true,
        "duration": 7200,
        "note": "Stuff",
        "started_at": "2016-08-16T20:00:00.000Z",
        "client_id": "2149780",
        "identity_id":"8804571",
        "project_id": "153125"
    }
}


Response:


{
  "time_entry": {
      "note": "Stuff",
      "duration": 7200,
      "project_id": 153125,
      "client_id": 2149780,
      "is_logged": true,
      "started_at": "2016-08-16T20:00:00Z",
      "active": true,
      "id": 5100,
      "timer": null
  }
}

Update a Time Entry

Request:

PUT "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries/<time_entry_id>"


{
  "time_entry": {
      "is_logged": true,
      "duration": 600,
      "note": "Updated Note",
      "started_at": "2016-08-16T18:03:28.000Z",
      "timer": {
          "id": "2936"
      },
      "client_id": "2227125",
      "project_id": "153125"
  }
}


Response:


{
    "time_entry": {
        "note": "Updated Note",
        "duration": 600,
        "project_id": 153125,
        "client_id": 2227125,
        "is_logged": true,
        "started_at": "2016-08-16T18:03:28Z",
        "active": true,
        "id": 5095,
        "timer": {
            "id": 2936,
            "is_running": false
        }
    }
}

Delete a Time Entry

Request:

DELETE https://api.freshbooks.com/timetracking/business/<business_id>/time_entries/<time_entry_id>

Response:

(status 204) NO CONTENT




Fetch time entries

Request: GET

"https://api.freshbooks.com/timetracking/business/<business_id>/time_entries"


url = "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries"
headers = {'Authorization': 'Bearer <Bearer Token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
 res = requests.get(url, data=None, headers=headers)


Response:


{
    "time_entries": [
      {
         "note": "Things",
         "duration": 30,
          "project_id": 153125,
         "client_id": 2227125,
         "is_logged": true,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5095,
          "timer": {
              "id": 2936,
             "is_running": false
          }
      }
 ],
 "meta": {
     "pages": 1,
     "total_logged": 30,
     "total_unbilled": 30,
     "per_page": 15,
     "total": 1,
      "page": 1
  }
}

Fetch Time Entries for a given day

Request: GET 

"https://api.freshbooks.com/timetracking/business/<business_id>/time_entries?page=0&started_from=2016-08-17T04%3A00%3A00Z&started_to=2016-08-18T03%3A59%3A59Z"


url = "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries?page=0&started_from=2016-08-17T04%3A00%3A00Z&started_to=2016-08-18T03%3A59%3A59Z"
headers = {'Authorization': 'Bearer <Bearer Token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
res = requests.get(url, data=None, headers=headers)


Response:


{
  "time_entries": [
      {
          "note": "Things",
          "duration": 30,
          "project_id": 153125,
          "client_id": 2227125,
          "is_logged": true,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5095,
          "timer": {
              "id": 2936,
              "is_running": false
          }
      }
  ],
 "meta": {
      "pages": 1,
      "total_logged": 30,
      "total_unbilled": 30,
      "per_page": 4,
      "total": 1,
      "page": 1
  }
}

Fetch Time Entries that have been updated since a precise time

Request: GET 

"https://api.freshbooks.com/timetracking/business/<business_id>/time_entries?updated_since=2015-08-01T03%3A00%3A00Z&include_deleted=1"


url = "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries?updated_since=2015-08-01T03%3A00%3A00Z&include_deleted=1"
headers = {'Authorization': 'Bearer <Bearer Token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
res = requests.get(url, data=None, headers=headers)


Response:


{
   "time_entries": [
      {
          "note": null,
          "duration": null,
          "project_id": 153125,
          "client_id": 2149780,
          "is_logged": false,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5097,
          "timer": {
              "id": 2938,
              "is_running": true
          }
      },
      {
          "note": null,
          "duration": null,
          "project_id": null,
          "client_id": 2149780,
          "is_logged": false,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5098,
          "timer": {
              "id": 2939,
              "is_running": true
          }
      },
      {
          "note": null,
          "duration": null,
          "project_id": null,
          "client_id": 2149780,
          "is_logged": false,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5096,
          "timer": {
              "id": 2937,
              "is_running": true
          }
      },
      {
          "note": "Things",
          "duration": 30,
          "project_id": 153125,
          "client_id": 2227125,
          "is_logged": true,
          "started_at": "2016-08-16T18:03:28Z",
          "active": true,
          "id": 5095,
          "timer": {
              "id": 2936,
              "is_running": false
          }
      }
  ],
  "meta": {
      "pages": 1,
      "total_logged": 30,
      "total_unbilled": 30,
      "per_page": 4,
      "total": 4,
      "page": 1
  }
}


Create a Time Entry



request: POST 

"https://api.freshbooks.com/timetracking/business/<business_id>/time_entries"


url = "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries"
headers = {'Authorization': 'Bearer <Bearer Token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
payload = {
  "time_entry": {
    "is_logged": true,
    "duration": 7200,
    "note": "stuff",
    "started_at": "2016-08-16T20:00:00.000Z",
    "client_id": "2149780",
    "project_id": "153125"
  }
}


Response:


{
   "time_entry": {
      "note": "Stuff",
      "duration": 7200,
      "project_id": 153125,
      "client_id": 2149780,
      "is_logged": true,
      "started_at": "2016-08-16T20:00:00Z",
      "active": true,
      "id": 5100,
      "timer": null
  }
}

Update a Time Entry

Request: PUT

"https://api.freshbooks.com/timetracking/business/<business_id>/time_entries/<time_entry_id>"


url = "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries/<time_entry_id>"
headers = {'Authorization': 'Bearer <Bearer Token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
payload = {
  "time_entry": {
    "is_logged": true,
    "duration": 600,
    "note": "Updated Note",
    "started_at": 2016-08-16T18:03:28.000Z
    "timer": {
      "id": "2936"
    },
    "client_id": "2227125",
    "project_id": "153125"
  }
}


Response:


{
  "time_entry": {
        "note": "Updated Note",
        "duration": 600,
        "project_id": 153125,
        "client_id": 2227125,
        "is_logged": true,
        "started_at": "2016-08-16T18:03:28Z",
        "active": true,
        "id": 5095,
        "timer": {
            "id": 2936,
            "is_running": false
        }
    }
}

Delete a Time Entry

Request: DELETE

https://api.freshbooks.com/timetracking/business/<business_id>/time_entries/<time_entry_id>


url = "https://api.freshbooks.com/timetracking/business/<business_id>/time_entries/<time_entry_id>"
headers = {'Authorization': 'Bearer <Bearer Token>', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
res = requests.delete(url, data=None, headers=headers)


Response:


(Status 204) NO CONTENT