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
idorcode— returns a single task (see Get a single task below). - With neither — returns the paginated list of team tasks (requires
start_at).
List team tasks
Section titled “List team tasks”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;}Get a single task by id or code
Section titled “Get a single task by id or code”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
idis the task’s UUID.codeis the task’s human-readable code in the form<TEAM_CODE>-<NUMBER>(the same value returned ascodeon a task), e.g.UNF-123. Acoderesolves to the top-level task for that number.- Provide exactly one of
idorcode. Providing both returns400. Providing neither falls back to the paginated list described above. - The task must belong to the API client’s team, otherwise
404is returned.
Response
A single Task object — the same shape as the entries in the tasks array above.
Errors
400– bothidandcodesupplied, or an invalidid/code.404– no task with thatid/codein the client’s team.
