Skip to content

Search projects

Request

🔐 Required role: API_ADMIN

📖 Data dictionary: Project

Advanced project 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.

Projects are stored in the Jobs table (vw_job view). Supports manager, dates, and flags. where and orderBy use the project field names of the response (camelCase, for example status, isActive, partnerStaffId, managerStaffId, updatedAt); an unknown field is rejected with 400. The response holds the matching rows in projects and the number of projects matching where in total.aggregate.count.

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 project filtering

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

Dynamic ordering specifications

Example:
[ { "updatedAt": "desc" }, { "name": "asc" } ]
curl -i -X POST \
  https://api.sandbox.aiwyn.app/gql/v1/projects/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": [
            {
              "name": {
                "_ilike": "%migration%"
              }
            },
            {
              "serviceDescription": {
                "_ilike": "%review%"
              }
            }
          ]
        },
        {
          "isActive": {
            "_eq": true
          }
        },
        {
          "updatedAt": {
            "_gte": "1900-01-01T00:00:00Z"
          }
        },
        {
          "partnerStaffId": {
            "_in": [
              101,
              102,
              103
            ]
          }
        }
      ]
    },
    "orderBy": [
      {
        "updatedAt": "desc"
      },
      {
        "name": "asc"
      }
    ]
  }'

Responses

Successfully retrieved filtered projects

Bodyapplication/json
projectsArray of objects(Project)required
totalobject(AggregateCount)required

Standard count aggregation

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