Query Language
Filter and query data using conditional operators and parameters
Queries can be made using query string parameters on any object or nested object attribute. You can specify advanced conditional operators like greater-than or boolean on any parameter as described below.
All query conditionals must follow the standard query string formatting rules and all special characters must be encoded.
Select, Update, and Delete operations can be performed on query results.
Conditional Queries
Less-Than Conditional
Query for records where a numeric field is less than a specified value.
Combining Less-Than and Greater-Than
Combine multiple operators to create range queries for numeric values.
OR Conditional
Match records where a field equals any of multiple values using OR logic.
Like Conditional
Search for records containing specific text within a field.
Combined Conditional Example
Combine multiple query conditions for complex filtering logic.
Nested Object Parameters
Nested objects or lists can be referenced as a query string parameter using the following syntax:
Nested Object Parameters
?object[attr]=value
2nd Degree Nested Object Parameters
?object[subobject][attr]=value
Nested List
?list[0]=value
Nested List of Objects
?list[0][attr]=value
Query Operators
| Conditional | Description |
|---|---|
attr=value | Equal |
attr=!value | Not Equal |
attr=<value | Less-Than |
attr=<=value | Less-Than or Equal |
attr=>value | Greater-Than |
attr=>=value | Greater-Than or Equal |
attr=<value1|>value2 | Or |
attr=!value&attr=>value | And |
attr=?*value* | Like |
Query String Examples
Basic Equality
https://api.payload.com/customers/?status=activeRange Queries
https://api.payload.com/transactions/?amount=>100&amount=<1000OR Conditions
https://api.payload.com/payments/?status=processed|pendingNested Object Queries
https://api.payload.com/invoices/?customer[email][email protected]Like/Contains Queries
https://api.payload.com/customers/?name=?*John*Date Queries
https://api.payload.com/transactions/?created_at=>2023-01-01&created_at=<2023-12-31