Skip to content

Search WIP entries

Request

🔐 Required role: API_ADMIN

📖 Data dictionary: Work in progress (WIP)

Advanced WIP 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 wipType selection, date ranges, and client/job constraints. Without a where, only active WIP records are returned (the default is { "isActive": { "_eq": true } }). A where replaces that default, so add isActive to it to keep excluding inactive records. Default order is loggedDate desc, createdAt desc.

Security
(BearerAuth and CfAccessClientId and CfAccessClientSecret) or BearerAuth
Bodyapplication/json
pageSizeinteger, [ 1 .. 1000 ]

Limit — number of records to return (not a page count). Hasura maps this to limit.

Default:50
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
whereobject

Flexible where clause for complex WIP filtering

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

Dynamic ordering specifications. Defaults to [{ "loggedDate": "desc" }, { "createdAt": "desc" }].

Example:
[ { "loggedDate": "desc" }, { "wipValue": "desc" } ]
curl -i -X POST \
  https://api.sandbox.aiwyn.app/gql/v1/wips/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": 1,
    "where": {
      "_and": [
        {
          "_or": [
            {
              "wipType": {
                "_in": [
                  "Time",
                  "Expense"
                ]
              }
            },
            {
              "notes": {
                "_ilike": "%consultation%"
              }
            }
          ]
        },
        {
          "isActive": {
            "_eq": true
          }
        },
        {
          "loggedDate": {
            "_gte": "1900-01-01T00:00:00Z"
          }
        },
        {
          "clientId": {
            "_in": [
              1001,
              1002,
              1003
            ]
          }
        }
      ]
    },
    "orderBy": [
      {
        "loggedDate": "desc"
      },
      {
        "wipValue": "desc"
      }
    ]
  }'

Responses

Successfully retrieved filtered WIP entries

Bodyapplication/json
wipsArray of objectsrequired

WIP records matching the filter (at most pageSize)

totalobjectrequired

Count and financial aggregates over every record matching the filter (ignores pagination)

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