- Search tasks
🔐 Required role:
API_ADMIN📖 Data dictionary: Task
Advanced task filtering with a flexible where clause and dynamic ordering
Uses standard limit/offset pagination via pageSize and page — see Pagination. Use total.aggregate.count to detect the end.
Supports flexible filtering across any task field — including nested relations such as taskType and job — using a flexible where clause, with pagination and dynamic ordering.
Common filter examples (pass in the where field):
- By task type ID:
{ "taskTypeId": { "_eq": 123 } } - By task type code:
{ "taskType": { "code": { "_eq": "PREP" } } } - By client:
{ "job": { "clientId": { "_eq": 456 } } } - Start date range:
{ "startDate": { "_gte": "2024-01-01", "_lte": "2024-12-31" } } - Due date range:
{ "dueDate": { "_gte": "2024-01-01", "_lte": "2024-12-31" } } - By assignee:
{ "assigneeStaffId": { "_eq": 789 } } - Combined:
{ "_and": [ { "taskType": { "code": { "_eq": "PREP" } } }, { "assigneeStaffId": { "_eq": 789 } } ] }
Limit — number of records to return (not a page count).
Offset — number of records to skip. This is not a page index. To fetch the next N rows after the first N, send pageSize: N and page: N. An offset at or beyond total.aggregate.count returns an empty result array.
Flexible where clause for filtering. Supports operators such as _eq, _neq, _in, _nin, _ilike, _gte, _lte, and logical combinators _and, _or, _not. Nested relations taskType and job can be filtered inline.
{ "_and": [ { … }, { … } ] }
- Sandbox (requires Cloudflare Access headers)https://api.sandbox.aiwyn.app/gql/v1/tasks/search
- Staging (requires Cloudflare Access headers)https://api.staging.aiwyn.app/gql/v1/tasks/search
- Production (your live firm data; no Cloudflare Access headers)https://api.aiwyn.ai/gql/v1/tasks/search
curl -i -X POST \
https://api.sandbox.aiwyn.app/gql/v1/tasks/search \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'CF-Access-Client-Id: YOUR_API_KEY_HERE' \
-H 'CF-Access-Client-Secret: YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"pageSize": 25,
"page": 0,
"where": {
"_and": [
{
"taskType": {
"code": {
"_eq": "PREP"
}
}
},
{
"assigneeStaffId": {
"_eq": 789
}
}
]
},
"orderBy": [
{
"dueDate": "asc"
}
]
}'{ "tasks": [ { … } ], "total": { "aggregate": { … } } }