Search Operators

Reference for all query operators supported across Clowk search endpoints

Overview

All Clowk search endpoints (/users/search, /sessions/search) accept a query parameter using a structured query language inspired by Zendesk Search.

Filters are space-separated tokens. Each token is a field, an operator, and a value:

field:value
field:value* field:*value field:*value*
field>value field<value field>=value field<=value
-field:value

Multiple tokens are combined with AND by default. Repeating the same field produces an OR.

Operator reference

OperatorTypeBehaviorExample
field:valueExactReturns records where field equals value exactlyprovider:google
field:value*Starts withReturns records where field starts with valueemail:alice*
field:*valueEnds withReturns records where field ends with valueemail:*@gmail.com
field:*value*ContainsReturns records where field contains valuename:*Silva*
field>valueGreater thanReturns records where field is after/above valuecreated_at>2026-01-01
field<valueLess thanReturns records where field is before/below valuecreated_at<2026-01-01
field>=valueGreater than or equalInclusive lower boundcreated_at>=2026-01-01
field<=valueLess than or equalInclusive upper boundcreated_at<=2026-03-31
-field:valueNegationExcludes records matching the token-provider:twitter

Wildcards (*) are only meaningful on string fields. On datetime and numeric fields, use >, <, >=, <= instead.

OR — same field, multiple tokens

Repeating the same field in a query combines the values with OR:

provider:google provider:github

→ sessions from Google or GitHub.

email:alice@example.com email:bob@example.com

→ users matching either email exactly.

Different fields are always combined with AND:

email:*@gmail.com created_at>2026-01-01

→ Gmail users and created after January 2026.

Negation

Prefix any token with - to exclude matches:

-provider:twitter

→ all sessions except Twitter.

-email:*test* -email:*staging*

→ users whose email doesn't contain test or staging.

Negation applies per token and is always AND'd with the rest of the query.

Wildcard patterns

The position of * controls the match pattern:

TokenPatternSQL
email:alice*Starts with aliceemail ILIKE 'alice%'
email:*@gmail.comEnds with @gmail.comemail ILIKE '%@gmail.com'
email:*gmail*Contains gmailemail ILIKE '%gmail%'
email:alice@example.comExact (no wildcard)email = 'alice@example.com'

Spaces are token separators — values with spaces require wildcards. Use name:*Doe* instead of name:Jane Doe.

Date and time values

Use ISO 8601 date strings for datetime comparisons:

created_at>2026-01-01
last_signin_at>=2026-03-01
logged_in_at<2026-01-01T12:00:00Z

Combined examples

Gmail or Yahoo users created in Q1 2026:

email:*@gmail.com email:*@yahoo.com created_at>=2026-01-01 created_at<=2026-03-31

Active Google or GitHub sessions signed in after March 1:

provider:google provider:github last_signin_at>2026-03-01

All sessions except Twitter from a specific IP range:

-provider:twitter ip_address:10.0.*

Users with "silva" in their name, excluding test accounts:

name:*silva* -email:*test*

Ignored tokens

  • Tokens without a valid operator are silently ignored.
  • Fields that don't exist on the resource are silently ignored.
  • Sensitive fields (password_digest, secret_key, kv) are always excluded regardless of the query.

On this page