Deprecated as of version 2025-09-03This page describes the API for versions up to and including
2022-06-28. In the new 2025-09-03 version, the concepts of databases and data sources were split up, as described in Upgrading to 2025-09-03.Refer to the new page instead:filter object in the body of the request that limits the returned entries based on the specified criteria.
For example, the below query limits the response to entries where the "Task completed" checkbox property value is true:
and and or keys so that multiple filters are applied at the same time. (See Query a database for additional examples.)
The filter object
Eachfilter object contains the following fields:
The filter object mimics the database filter option in the Notion UI.
Type-specific filter conditions
Checkbox
Date
For the
after, before, equals, on_or_before, and on_or_after fields, if a date string with a time is provided, then the comparison is done with millisecond precision.If no timezone is provided, then the timezone defaults to UTC.date property value types and the timestamp property types created_time and last_edited_time.
The condition contains the below fields:
Relative date values
Theafter, before, equals, on_or_after, and on_or_before fields accept the following relative date strings in addition to ISO 8601 dates. These are resolved at query time:
Files
Formula
The primary field of theformula filter condition object matches the type of the formula’s result. For example, to filter a formula property that computes a checkbox, use a formula filter condition object with a checkbox field containing a checkbox filter condition as its value.
Multi-select
Number
People
You can apply a people filter condition topeople, created_by, and last_edited_by database property types.
The people filter condition contains the following fields:
The
"me" value resolves to the user associated with the token. For public connections, this is the user who completed the OAuth flow. For personal access tokens, this is the user who created the token. For internal connections, there is no associated user — contains: "me" returns no results and does_not_contain: "me" matches all entries.Relation
Rich text
Rollup
A rollup database property can evaluate to an array, date, or number value. The filter condition for the rollup property contains arollup key and a corresponding object value that depends on the computed value type.
Filter conditions for array rollup values
Filter conditions for date rollup values
A rollup value is stored as a date only if the “Earliest date”, “Latest date”, or “Date range” computation is selected for the property in the Notion UI.
Filter conditions for number rollup values
Select
Status
Timestamp
Use a timestamp filter condition to filter results based oncreated_time or last_edited_time values.
Verification
ID
Use a timestamp filter condition to filter results based on theunique_id value.
Compound filter conditions
You can use a compound filter condition to limit the results of a database query based on multiple conditions. This mimics filter chaining in the Notion UI.
and or or key with a value that is an array of filter objects or nested compound filter objects. Nesting is supported up to two levels deep.