Project Task Assignments
Admin or Project Manager permissions required.
The task assignment object
Attribute | Type | Description |
---|---|---|
id |
integer | Unique ID for the task assignment. |
project |
object | An object containing the id, name, and code of the associated project. |
task |
object | An object containing the id and name of the associated task. |
is_active |
boolean | Whether the task assignment is active or archived. |
billable |
boolean | Whether the task assignment is billable or not. For example: if set to true, all time tracked on this project for the associated task will be marked as billable. |
hourly_rate |
decimal | Rate used when the project’s bill_by is Tasks . |
budget |
decimal | Budget used when the project’s budget_by is task or task_fees . |
created_at |
datetime | Date and time the task assignment was created. |
updated_at |
datetime | Date and time the task assignment was last updated. |
List all task assignments
Returns a list of your task assignments. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first.
The response contains an object with a task_assignments
property that contains an array of up to per_page
task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments.
GET /v2/task_assignments
Parameter | Type | Description |
---|---|---|
is_active |
boolean | Pass true to only return active task assignments and false to return inactive task assignments. |
updated_since |
datetime | Only return task assignments that have been updated since the given date and time. |
page |
integer | DEPRECATED The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) |
per_page |
integer | The number of records to return per page. Can range between 1 and 2000. (Default: 2000) |
page
parameter.
For more information, visit the pagination guide.
Example Request:
curl "https://api.harvestapp.com/v2/task_assignments" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])"
Example Response:
List all task assignments for a specific project
Returns a list of your task assignments for the project identified by PROJECT_ID
. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first.
The response contains an object with a task_assignments
property that contains an array of up to per_page
task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments.
GET /v2/projects/{PROJECT_ID}/task_assignments
Parameter | Type | Description |
---|---|---|
is_active |
boolean | Pass true to only return active task assignments and false to return inactive task assignments. |
updated_since |
datetime | Only return task assignments that have been updated since the given date and time. |
page |
integer | The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) |
per_page |
integer | The number of records to return per page. Can range between 1 and 2000. (Default: 2000) |
Example Request:
curl "https://api.harvestapp.com/v2/projects/14308069/task_assignments" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])"
Example Response:
Retrieve a task assignment
Retrieves the task assignment with the given ID. Returns a task assignment object and a 200 OK
response code if a valid identifier was provided.
GET /v2/projects/{PROJECT_ID}/task_assignments/{TASK_ASSIGNMENT_ID}
Example Request:
curl "https://api.harvestapp.com/v2/projects/14308069/task_assignments/155505016" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])"
Example Response:
Create a task assignment
Creates a new task assignment object. Returns a task assignment object and a 201 Created
response code if the call succeeded.
POST /v2/projects/{PROJECT_ID}/task_assignments
Parameter | Type | Required | Description |
---|---|---|---|
task_id |
integer | required | The ID of the task to associate with the project. |
is_active |
boolean | optional | Whether the task assignment is active or archived. Defaults to true . |
billable |
boolean | optional | Whether the task assignment is billable or not. Defaults to false . |
hourly_rate |
decimal | optional | Rate used when the project’s bill_by is Tasks . Defaults to null when billing by task hourly rate, otherwise 0 . |
budget |
decimal | optional | Budget used when the project’s budget_by is task or task_fees . |
Example Request:
curl "https://api.harvestapp.com/v2/projects/14308069/task_assignments" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X POST \
-H "Content-Type: application/json" \
-d '{"task_id":8083800,"is_active":true,"billable":true,"hourly_rate":75.50}'
Example Response:
Update a task assignment
Updates the specific task assignment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a task assignment object and a 200 OK
response code if the call succeeded.
PATCH /v2/projects/{PROJECT_ID}/task_assignments/{TASK_ASSIGNMENT_ID}
Parameter | Type | Description |
---|---|---|
is_active |
boolean | Whether the task assignment is active or archived. |
billable |
boolean | Whether the task assignment is billable or not. |
hourly_rate |
decimal | Rate used when the project’s bill_by is Tasks . |
budget |
decimal | Budget used when the project’s budget_by is task or task_fees . |
Example Request:
curl "https://api.harvestapp.com/v2/projects/14308069/task_assignments/155506339" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"budget":120}'
Example Response:
Delete a task assignment
Delete a task assignment. Deleting a task assignment is only possible if it has no time entries associated with it. Returns a 200 OK
response code if the call succeeded.
DELETE /v2/projects/{PROJECT_ID}/task_assignments/{TASK_ASSIGNMENT_ID}
Example Request:
curl "https://api.harvestapp.com/v2/projects/14308069/task_assignments/155506339" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X DELETE