×
FreshBooks
Official App
Free – Google Play
Get it

Time Entries

General Info

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

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
Betweenstarted_frommatches entries that take place at or after the specified utc date/time
Betweenstarted_tomatches entries that take place before or at the specified utc date/time
Betweenupdated_sincematches entries that have been updated at or after the specified utc date/time

Field Descriptions

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
started_atdatetimeThe date/time in UTC when the work started

Fetch 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
    }
} 

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

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

{
  "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",
        "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