Skip to content

GET tasks

GET /api/rest/v1/teams/tasks returns tasks within the team that the API client belongs to. Its behaviour depends on the query parameters:

  • With id or code — returns a single task (see Get a single task below).
  • With neither — returns the paginated list of team tasks (requires start_at).

Returns tasks that meet the following criteria (within the team that the API client belongs to)

  • All tasks, archived, subtasks and completed
  • Not deleted
  • Sorted by created at DESC
  • end_at is optional - to limit results

GET thgflow.com/api/rest/v1/teams/tasks?start_at=9829380198&end_at=83209808080980

Response

{
"tasks": Task[], // see below
"number_of_results": 29031923,
"last_created_at_returned": "string" // for pagination
}
export interface Task {
parent_task_id?: string;
id: string;
code: string;
team_id: string;
assigned_users: AssignedUser[];
assigned_user_groups: AssignedGroup[];
status?: Status;
name: string;
is_archived: boolean;
is_completed: boolean;
template: Template;
linked_tasks: LinkedTask[];
subtask_ids: string[];
created_by: User;
metadata: {};
start_at?: number;
end_at?: number;
created_at: number;
updated_at: number;
tags?: string[];
project?: TaskProject;
}

The same route returns a single task when called with an id or a code query parameter, instead of the paginated list above.

GET thgflow.com/api/rest/v1/teams/tasks?id=844edcef-835a-48dd-b4aa-d5c398807193

GET thgflow.com/api/rest/v1/teams/tasks?code=UNF-123

  • id is the task’s UUID.
  • code is the task’s human-readable code in the form <TEAM_CODE>-<NUMBER> (the same value returned as code on a task), e.g. UNF-123. A code resolves to the top-level task for that number.
  • Provide exactly one of id or code. Providing both returns 400. Providing neither falls back to the paginated list described above.
  • The task must belong to the API client’s team, otherwise 404 is returned.

Response

A single Task object — the same shape as the entries in the tasks array above.

Errors

  • 400 – both id and code supplied, or an invalid id/code.
  • 404 – no task with that id/code in the client’s team.