Skip to content

Search task types

Request

🔐 Required role: API_ADMIN

📖 Data dictionary: Task type

Advanced task type 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 type field using a flexible where clause, with pagination and dynamic ordering.

Deactivated task types (including deactivated TimeCode records) are included, unlike GET /gql/v1/task-types; filter on active to choose them: { "active": { "_eq": false } } returns only deactivated task types.

Common filter examples (pass in the where field):

  • By code: { "code": { "_eq": "PREP" } }
  • By active status: { "active": { "_eq": true } }
  • By billable flag: { "billable": { "_eq": true } }
  • By category: { "taskTypeCategoryId": { "_eq": 5 } }
  • By service line: { "serviceLineId": { "_eq": 2 } }
  • Combined: { "_and": [ { "billable": { "_eq": true } }, { "active": { "_eq": true } } ] }
Security
(BearerAuth and CfAccessClientId and CfAccessClientSecret) or BearerAuth
Bodyapplication/jsonrequired
pageSizeinteger, [ 1 .. 1000 ]

Limit — number of records to return (not a page count).

Default:50
Example:25
pageinteger, >= 0

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.

Default:0
Example:0
whereobject

Flexible where clause for filtering. Supports operators such as _eq, _neq, _in, _nin, _ilike, _gte, _lte, and logical combinators _and, _or, _not.

Example:
{ "_and": [ { … }, { … } ] }
orderByArray of objects

Dynamic ordering specifications. Each element is an object mapping a field name to "asc" or "desc". Defaults to [{ "display": "asc" }].

Example:
[ { "display": "asc" } ]
curl -i -X POST \
  https://api.sandbox.aiwyn.app/gql/v1/task-types/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": [
        {
          "billable": {
            "_eq": true
          }
        },
        {
          "active": {
            "_eq": true
          }
        }
      ]
    },
    "orderBy": [
      {
        "display": "asc"
      }
    ]
  }'

Responses

Task types retrieved successfully

Bodyapplication/json
taskTypesArray of objects

List of task types matching the filter criteria

totalobject

Aggregate count matching the filter (ignores pagination)

Response
{ "taskTypes": [ { … } ], "total": { "aggregate": { … } } }