API reference
//Search contacts
🔐 Required role:
API_ADMIN📖 Data dictionary: Contact
Advanced contact filtering with flexible where clauses and dynamic ordering
Uses standard limit/offset pagination via pageSize and page — see Pagination. Use total.aggregate.count to detect the end.
Filter contacts using boolean logic and relationship-aware fields from contact_info.
Security
(BearerAuth and CfAccessClientId and CfAccessClientSecret) or BearerAuth
Limit — number of records to return (not a page count). Hasura maps this to limit. Defaults to 50 when omitted.
Default:50
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
Flexible where clause for complex contact filtering
Example:
{ "_and": [ { … }, { … }, { … }, { … } ] }
- Sandbox (requires Cloudflare Access headers)https://api.sandbox.aiwyn.app/gql/v1/contacts/search
- Staging (requires Cloudflare Access headers)https://api.staging.aiwyn.app/gql/v1/contacts/search
- Production (your live firm data; no Cloudflare Access headers)https://api.aiwyn.ai/gql/v1/contacts/search
curl -i -X POST \
https://api.sandbox.aiwyn.app/gql/v1/contacts/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": [
{
"contact_info": {
"firstName": {
"_ilike": "%john%"
}
}
},
{
"contact_info": {
"lastName": {
"_ilike": "%doe%"
}
}
}
]
},
{
"active": {
"_eq": true
}
},
{
"createdAt": {
"_gte": "1900-01-01T00:00:00Z"
}
},
{
"contact_info": {
"email": {
"_ilike": "%@company.com%"
}
}
}
]
},
"orderBy": [
{
"contact_info": {
"lastName": "asc"
}
},
{
"createdAt": "desc"
}
]
}'Response
{ "contacts": [ { … } ], "total": { "aggregate": { … } } }