API Documentation

Time Tracking

Extended REST API
Clients
Projects
Tasks
People
Expenses
Expense Tracking
User Assignment
Task Assignment
Reports
Invoices
Invoice Messages
Invoice Payments
Invoice Categories


Questions?
Email support@getharvest.com

Task Assignment: Assigning tasks to projects

Get all tasks assigned to a given project

GET /projects/#{project_id}/task_assignments

HTTP Response: 200 OK
<task-assignments>
  <task-assignment>
    <id>23</id>
    <project-id>3</project-id>
    <task-id>2878</task-id>
    <!-- True if task is billable for this project -->
    <billable>true</billable>
    <!-- True if task was deactivated for project, preventing further
    hours to be logged against it -->
    <deactivated>true</deactivated>
    <!-- The estimate (if present) for the task in project -->
    <estimate>80</estimate>
    <!-- The hourly rate (if present) for the task in project -->
    <hourly-rate>80</hourly-rate>
  </task-assignment>
  <task-assignment>
    ...
  </task-assignment>
</task-assignments>

Get one task assignment

GET /projects/#{project_id}/task_assignments/#{task_assignment_id}

HTTP Response: 200 OK
<task-assignment>
  <id>23</id>
  <project-id>3</project-id>
  <task-id>2878</task-id>
  <!-- True if task is billable for this project -->
  <billable>true</billable>
  <!-- True if task was deactivated for project, preventing further
  hours to be logged against it -->
  <deactivated>true</deactivated>
  <!-- The estimate (if present) for the task in project -->
  <estimate>80</estimate>
  <!-- The hourly rate (if present) for the task in project -->
  <hourly-rate>80</hourly-rate>
</task-assignment>

Assign a task to a project

POST /projects/#{project_id}/task_assignments

HTTP Response: 201 Created
Location: /projects/#{project_id}/task_assignments/#{new_task_assignment_id}

You will have to post the following:

<task>
 <id>653425<id>
<task>

Create a new task and assign it to a project

POST /projects/#{project_id}/task_assignments/add_with_create_new_task

HTTP Response: 201 Created
HTTP Response: 201 Created
Location: /projects/#{project_id}/task_assignments/#{new_task_assignment_id}

You will have to post the following:

<task>
  <name>Backend Development</name>
</task>

Removing a task from a project

DELETE /projects/#{project_id}/task_assignments/#{task_assignment_id}

HTTP Response: 200 OK

Note that Harvest requires one task per project.

Harvest will not remove the task if it has recorded hours against the project. Instead we will archive the assignment. Harvest will reply with a custom Hint header if archiving occurred.


Changing a task for a project

PUT /projects/#{project_id}/task_assignments/#{task_assignment_id}

HTTP Response: 200 Success

You will have to post the following:

<task-assignment>
  <billable>true</billable>
  <deactivated>false</deactivated>
  <estimate>3234</estimate>
  <hourly-rate></hourly-rate>
</task-assignment>