Skip to content

Search engagements

Request

🔐 Required role: API_ADMIN

📖 Data dictionary: Engagement

Search Engagements with Dynamic Filters

Uses standard limit/offset pagination via pageSize and page — see Pagination. Use total.aggregate.count to detect the end.

This endpoint allows you to search engagements using dynamic filters, enabling flexible querying based on various criteria.

The response holds the matching rows in engagements (the same row shape as the list operation) and the number of engagements matching where in total.aggregate.count.

Features:

  • Supports multiple filter conditions
  • Pagination for large result sets
  • Sorting options for results
Security
(BearerAuth and CfAccessClientId and CfAccessClientSecret) or BearerAuth
Bodyapplication/jsonrequired
pageSizeinteger, [ 1 .. 1000 ]

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

Default:50
Example:1
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 filtering

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

Dynamic ordering specifications

Example:
[ { "name": "asc" }, { "createdAt": "desc" } ]
curl -i -X POST \
  https://api.sandbox.aiwyn.app/gql/v1/engagements/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": "%review%"
              }
            },
            {
              "engagementNameTemplate": {
                "_ilike": "%tax%"
              }
            }
          ]
        },
        {
          "status": {
            "_in": [
              "SENT",
              "EXECUTED"
            ]
          }
        },
        {
          "createdAt": {
            "_gte": "1900-01-01T00:00:00Z"
          }
        },
        {
          "partnerStaffId": {
            "_in": [
              5,
              6,
              7,
              8
            ]
          }
        }
      ]
    },
    "orderBy": [
      {
        "name": "asc"
      },
      {
        "createdAt": "desc"
      }
    ]
  }'

Responses

Engagements retrieved successfully.

Bodyapplication/json
engagementsArray of objects(Engagement)required
totalobject(AggregateCount)required

Standard count aggregation

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