Tasks

Minimum access level: Time, unless stated otherwise.

Attributes

Required Attribute Description Kind
url The unique identifier for the task URI
name Task name String
is_billable true if charging your clients for the task, false otherwise Boolean
status One of the following:

  • Active
  • Completed
  • Hidden

String
created_at Creation of the task resource (UTC) Timestamp
updated_at When the task resource was last updated (UTC) Timestamp
Additional attributes available to users with Contacts & Projects permission
billing_rate The rate at which the project is billed, per billing_period Decimal
billing_period One of the following:

  • day
  • hour

String

List all tasks

GET https://api.freeagent.com/v2/tasks

Input

View Filters

GET https://api.freeagent.com/v2/tasks?view=active
  • all: Show all tasks (default)
  • active: Show only tasks with status active.
  • completed: Show only tasks with status completed.
  • hidden: Show only tasks with status hidden.

Date Filters

GET https://api.freeagent.com/v2/tasks?updated_since=2017-04-06
  • updated_since

Sort Orders

GET https://api.freeagent.com/v2/tasks?sort=updated_at
  • name: Sort by the task name (default).
  • project: Sort by the project_id associated with the task.
  • billing_rate: Sort by the billing rate.
  • created_at: Sort by the time the task was created.
  • updated_at: Sort by the time the task was last modified.

Response

Status: 200 OK
{ "tasks":[
  {
    "url":"https://api.freeagent.com/v2/tasks/1",
    "project":"https://api.freeagent.com/v2/projects/1",
    "name":"Sample Task",
    "is_billable":true,
    "billing_rate":"0.0",
    "billing_period":"hour",
    "status":"Active",
    "created_at":"2011-08-16T11:06:57Z",
    "updated_at":"2011-08-16T11:06:57Z"
  }
]}
Show as XML
<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <tasks type="array">
    <task>
      <url>https://api.freeagent.com/v2/tasks/1</url>
      <project>https://api.freeagent.com/v2/projects/1</project>
      <name>Sample Task</name>
      <is-billable type="boolean">true</is-billable>
      <billing-rate type="decimal">0.0</billing-rate>
      <billing-period>hour</billing-period>
      <status>Active</status>
      <created-at type="datetime">2011-08-16T11:06:57Z</created-at>
      <updated-at type="datetime">2011-08-16T11:06:57Z</updated-at>
    </task>
  </tasks>
</freeagent>
Show as JSON

List all tasks under a certain project

GET https://api.freeagent.com/v2/tasks?project=https://api.freeagent.com/v2/projects/2

Get a single task

GET https://api.freeagent.com/v2/tasks/:id

Response

Status: 200 OK
{ "task":
  {
    "project":"https://api.freeagent.com/v2/projects/1",
    "name":"Sample Task",
    "is_billable":true,
    "billing_rate":"0.0",
    "billing_period":"hour",
    "status":"Active",
    "created_at":"2011-08-16T11:06:57Z",
    "updated_at":"2011-08-16T11:06:57Z"
  }
}
Show as XML
<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <task>
    <project>https://api.freeagent.com/v2/projects/1</project>
    <name>Sample Task</name>
    <is-billable type="boolean">true</is-billable>
    <billing-rate type="decimal">0.0</billing-rate>
    <billing-period>hour</billing-period>
    <status>Active</status>
    <created-at type="datetime">2011-08-16T11:06:57Z</created-at>
    <updated-at type="datetime">2011-08-16T11:06:57Z</updated-at>
  </task>
</freeagent>
Show as JSON

Create a task under a certain project

POST https://api.freeagent.com/v2/tasks?project=:project

Payload should have a root task element, containing elements listed under Attributes.

Response

Status: 201 Created
Location: https://api.freeagent.com/v2/tasks/2
{ "task":
  {
    "project":"https://api.freeagent.com/v2/projects/1",
    "name":"Sample Task",
    "is_billable":true,
    "billing_rate":"0.0",
    "billing_period":"hour",
    "status":"Active",
    "created_at":"2011-08-16T11:06:57Z",
    "updated_at":"2011-08-16T11:06:57Z"
  }
}
Show as XML
<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <task>
    <project>https://api.freeagent.com/v2/projects/1</project>
    <name>Sample Task</name>
    <is-billable type="boolean">true</is-billable>
    <billing-rate type="decimal">0.0</billing-rate>
    <billing-period>hour</billing-period>
    <status>Active</status>
    <created-at type="datetime">2011-08-16T11:06:57Z</created-at>
    <updated-at type="datetime">2011-08-16T11:06:57Z</updated-at>
  </task>
</freeagent>
Show as JSON

Update a task

PUT https://api.freeagent.com/v2/tasks/:id

Payload should have a root task element, containing elements listed under Attributes that should be updated.

Response

Status: 200 OK

Delete a task

DELETE https://api.freeagent.com/v2/users/:id

Response

Status: 200 OK