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

Tasks

General Info

Tasks in Freshbooks represent services that your business offers to clients. Tasks are used to keep track of invoicing details of the service such as name and hourly rate. Tasks are automatically created for each project service and updates to tasks are reflected in the corresponding service and vice versa.

In general, when working with a project, use the services endpoint. When working with an invoice, use tasks.

*Requires Authorization*

Includes

Include Name Description
projects List of Projects that contain the task

Filters

Filter Type Name Field Description
Equals taskid taskid unique id related to a task
In taskids taskid matches list of taskids, one specified per query arg
Equals billable billable true if task is billable
Between rate_min rate list tasks with rates equal or greater
Between rate_max rate list tasks with rates equal or less
Between updated_min updated list of tasks that have been updated since the given date
Between updated_max updated list of tasks that have been updated before the given date
In projectids projectid matches list of projectids, one specified per query arg

Field Descriptions

underlined fields are required on creation

Field Type Description
updated DateTime the Date/Time the task was last updated
description string the description of the task
rate object subfields: amount, code
amount string the hourly amount charged for the task
code string the currency of the rate
taskid int the unique id for the task
billable boolean true if the task is billable
tname string the name for the task
tdesc string the description of the task
id int the unique id for the task
name string the name of the task
vis_state int 0 marks the task as active, 1 if inactive

Get a Single Task

Request: GET
https://api.freshbooks.com/accounting/account/<account_id>/projects/tasks/<task_id>

Response:


{
 "response": {
   "result": {
     "task": {
       "updated": "2017-07-24 09:39:21",
       "description": "",
       "vis_state": 0,
       "rate": {
         "amount": "100.00",
         "code": "CAD"
       },
       "taskid": 159361,
       "billable": true,
       "tname": "Piloting",
       "tdesc": "",
       "id": 159361,
       "name": "Piloting"
       }
     }
   }
 }

Create a Task

Request: POST
https://api.freshbooks.com/accounting/account/<account_id>/projects/tasks


  {
  "task": {
   "name": "Consulting"
  }

Update a Task

Request: PUT
https://api.freshbooks.com/accounting/account/<account_id>/projects/tasks/<task_id>


{
 "task": {
  "name": "Walking Dogs",
  "rate": {
    "amount": "25.47",
    "code": "CAD"
   }
  }
}

Response:


{
 "response": {
   "result": {
     "task": {
       "updated": "2017-07-24 10:09:18",
       "description": "",
       "vis_state": 0,
       "rate": {
         "amount": "25.47",
         "code": "CAD"
        },
       "taskid": 159365,
       "billable": true,
       "tname": "Walking Dogs",
       "tdesc": "",
       "id": 159365,
       "name": "Walking Dogs"
       }
     }
   }
 }
 

Delete a Task

Request: PUT
https://api.freshbooks.com/accounting/account/<account_id>/projects/tasks/<task_id>


{
 "task": {
    "vis_state": 1
   }
}

Response:


{
 "response": {
   "result": {
     "task": {
       "updated": "2017-07-24 10:13:38",
       "description": "",
       "vis_state": 1,
       "rate": {
        "amount": "25.47",
        "code": "CAD"
       },
       "taskid": 159365,
       "billable": true,
       "tname": "Walking Dogs",
       "tdesc": "",
       "id": 159365,
       "name": "Walking Dogs"
       }
     }
   }
 }

Listing Tasks

Request: GET
https://api.freshbooks.com/accounting/account/<account_id>/projects/tasks

Response:


  {
    "response": {
       "result": {
         "total": 3,
          "per_page": 15,
          "tasks": [
            {
                //same as single task
            },
            {
                //same as single task
            },
            {
                //same as single task
            }
          ],
          "page": 1,
          "pages": 1
          }
        }
      }
  

Search examples

Some Task Search Examples:

 

https://api.freshbooks.com/accounting/account/<account_id>/projects/tasks?search%5Bbillable%5D=false 

Returns all the tasks that are not billable

 

https://api.freshbooks.com/accounting/account/<account_id>/projects/tasks?search%5Brate_min%5D=25&search%5Brate_max%5D=75

Returns all the tasks with a rate between $25 and $100