curl --request POST \
--url https://api.example.com/api/v1/business/tasks/query \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"view": "list",
"query": {
"filter": {
"value": "<unknown>"
},
"sort": {
"sort_by": "created_at",
"sort_order": "desc"
},
"pagination": {
"cursor": "<string>",
"page_size": 50
},
"include_parents": false
}
}
'import requests
url = "https://api.example.com/api/v1/business/tasks/query"
payload = {
"view": "list",
"query": {
"filter": { "value": "<unknown>" },
"sort": {
"sort_by": "created_at",
"sort_order": "desc"
},
"pagination": {
"cursor": "<string>",
"page_size": 50
},
"include_parents": False
}
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
view: 'list',
query: {
filter: {value: '<unknown>'},
sort: {sort_by: 'created_at', sort_order: 'desc'},
pagination: {cursor: '<string>', page_size: 50},
include_parents: false
}
})
};
fetch('https://api.example.com/api/v1/business/tasks/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/business/tasks/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'view' => 'list',
'query' => [
'filter' => [
'value' => '<unknown>'
],
'sort' => [
'sort_by' => 'created_at',
'sort_order' => 'desc'
],
'pagination' => [
'cursor' => '<string>',
'page_size' => 50
],
'include_parents' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-project-id: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/business/tasks/query"
payload := strings.NewReader("{\n \"view\": \"list\",\n \"query\": {\n \"filter\": {\n \"value\": \"<unknown>\"\n },\n \"sort\": {\n \"sort_by\": \"created_at\",\n \"sort_order\": \"desc\"\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"page_size\": 50\n },\n \"include_parents\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-project-id", "<x-project-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/business/tasks/query")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"view\": \"list\",\n \"query\": {\n \"filter\": {\n \"value\": \"<unknown>\"\n },\n \"sort\": {\n \"sort_by\": \"created_at\",\n \"sort_order\": \"desc\"\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"page_size\": 50\n },\n \"include_parents\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/business/tasks/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"view\": \"list\",\n \"query\": {\n \"filter\": {\n \"value\": \"<unknown>\"\n },\n \"sort\": {\n \"sort_by\": \"created_at\",\n \"sort_order\": \"desc\"\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"page_size\": 50\n },\n \"include_parents\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"identifier": "<string>",
"title": "<string>",
"description": "<string>",
"status": "backlog",
"priority": "urgent",
"creator_type": "human",
"creator_id": "<string>",
"assignee_type": "human",
"assignee_id": "<string>",
"parent_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"due_date": "2023-12-25",
"sort_order": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"comment_count": 123,
"last_comment_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"subtask_count": {
"total": 0,
"completed": 0
},
"label_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"relation_ids": {}
}
],
"has_more": true,
"next_cursor": "<string>",
"parents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"identifier": "<string>",
"title": "<string>",
"description": "<string>",
"status": "backlog",
"priority": "urgent",
"creator_type": "human",
"creator_id": "<string>",
"assignee_type": "human",
"assignee_id": "<string>",
"parent_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"due_date": "2023-12-25",
"sort_order": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"comment_count": 123,
"last_comment_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"subtask_count": {
"total": 0,
"completed": 0
},
"label_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"relation_ids": {}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Query tasks
Search and list the project’s tasks, or get grouped totals across them.
Example: “Show me the in-progress tasks in this project”
Usage: set view to list for the matching tasks or counts for grouped totals. Narrow results with query.filter on fields like status, priority, assignee, labels, due date, and title, and order a list with query.sort. Lists come back in pages of up to 100 (50 by default); pass the cursor from the previous page to get the next one. For counts, set group_by (status, priority, assignee_id, or creator_id) - it is required for that view.
Response: for a list, a page of tasks with their core fields, labels, and subtask counts plus a cursor for the next page. For counts, the total and a per-group breakdown keyed by the field you grouped on.
curl --request POST \
--url https://api.example.com/api/v1/business/tasks/query \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"view": "list",
"query": {
"filter": {
"value": "<unknown>"
},
"sort": {
"sort_by": "created_at",
"sort_order": "desc"
},
"pagination": {
"cursor": "<string>",
"page_size": 50
},
"include_parents": false
}
}
'import requests
url = "https://api.example.com/api/v1/business/tasks/query"
payload = {
"view": "list",
"query": {
"filter": { "value": "<unknown>" },
"sort": {
"sort_by": "created_at",
"sort_order": "desc"
},
"pagination": {
"cursor": "<string>",
"page_size": 50
},
"include_parents": False
}
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
view: 'list',
query: {
filter: {value: '<unknown>'},
sort: {sort_by: 'created_at', sort_order: 'desc'},
pagination: {cursor: '<string>', page_size: 50},
include_parents: false
}
})
};
fetch('https://api.example.com/api/v1/business/tasks/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/business/tasks/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'view' => 'list',
'query' => [
'filter' => [
'value' => '<unknown>'
],
'sort' => [
'sort_by' => 'created_at',
'sort_order' => 'desc'
],
'pagination' => [
'cursor' => '<string>',
'page_size' => 50
],
'include_parents' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-project-id: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/business/tasks/query"
payload := strings.NewReader("{\n \"view\": \"list\",\n \"query\": {\n \"filter\": {\n \"value\": \"<unknown>\"\n },\n \"sort\": {\n \"sort_by\": \"created_at\",\n \"sort_order\": \"desc\"\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"page_size\": 50\n },\n \"include_parents\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-project-id", "<x-project-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/business/tasks/query")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"view\": \"list\",\n \"query\": {\n \"filter\": {\n \"value\": \"<unknown>\"\n },\n \"sort\": {\n \"sort_by\": \"created_at\",\n \"sort_order\": \"desc\"\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"page_size\": 50\n },\n \"include_parents\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/business/tasks/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"view\": \"list\",\n \"query\": {\n \"filter\": {\n \"value\": \"<unknown>\"\n },\n \"sort\": {\n \"sort_by\": \"created_at\",\n \"sort_order\": \"desc\"\n },\n \"pagination\": {\n \"cursor\": \"<string>\",\n \"page_size\": 50\n },\n \"include_parents\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"identifier": "<string>",
"title": "<string>",
"description": "<string>",
"status": "backlog",
"priority": "urgent",
"creator_type": "human",
"creator_id": "<string>",
"assignee_type": "human",
"assignee_id": "<string>",
"parent_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"due_date": "2023-12-25",
"sort_order": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"comment_count": 123,
"last_comment_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"subtask_count": {
"total": 0,
"completed": 0
},
"label_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"relation_ids": {}
}
],
"has_more": true,
"next_cursor": "<string>",
"parents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"identifier": "<string>",
"title": "<string>",
"description": "<string>",
"status": "backlog",
"priority": "urgent",
"creator_type": "human",
"creator_id": "<string>",
"assignee_type": "human",
"assignee_id": "<string>",
"parent_task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"due_date": "2023-12-25",
"sort_order": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"comment_count": 123,
"last_comment_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"subtask_count": {
"total": 0,
"completed": 0
},
"label_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"relation_ids": {}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Project ID for tenant scoping
Overrides the key's workspace
User API key
Body
'list' for a cursor page of task list items, 'counts' for grouped totals.
list, counts Filter, sort, and pagination. filter is shared by both views.
Show child attributes
Show child attributes
Group field for view='counts' (status/priority/assignee_id/creator_id). Required for counts.
status, priority, assignee_id, creator_id, page_id Response
Successful Response
- TaskQueryPage
- TaskCounts
items plus, when include_parents is requested, the immediate parents of this
page's items that are not already in items. Parents are page-local context, not
part of the paginated sequence.
Was this page helpful?