Handle all views queries operations in the Notion API
Note: Access this endpoint through the client instance, e.g., notion$views$queries. Not to be instantiated directly.
Methods
Method new()
Initialise pages properties endpoint.
Not to be called directly, e.g., use notion$views$queries instead.
Usage
ViewsQueriesEndpoint$new(client)Method create()
Create a view query
Arguments
view_idCharacter (required). The ID of the view.
page_sizeInteger. Number of items to return per page (1-100). Defaults to 100.
Method results()
Get view query results
Arguments
view_idCharacter (required). The ID of the view.
query_idCharacter (required). The ID of the query.
start_cursorCharacter. For pagination. If provided, returns results starting from this cursor. If NULL, returns the first page of results.
page_sizeInteger. Number of items to return per page (1-100). Defaults to 100
Examples
notion <- notion_client()
# ----- Create a view query
notion$views$queries$create("34033ea0-c1e4-8192-ac14-000cdad096ce")
#> {
#> "object": "view_query",
#> "id": "9af03bd1-ed79-4842-a57c-0bc04fb61be2",
#> "view_id": "34033ea0-c1e4-8192-ac14-000cdad096ce",
#> "expires_at": "2026-04-12T21:34:01.702+00:00",
#> "total_count": 1,
#> "results": [
#> {
#> "object": "page",
#> "id": "34033ea0-c1e4-81c4-afa0-d1ec98de4bec"
#> }
#> ],
#> "next_cursor": {},
#> "has_more": false,
#> "request_id": "b1c06f37-06d3-4633-9df2-a87eb48b8222"
#> }
# ----- Get view query results
notion$views$queries$results(
"34033ea0-c1e4-8192-ac14-000cdad096ce",
"9af03bd1-ed79-4842-a57c-0bc04fb61be2"
)
#> {
#> "object": "list",
#> "results": [
#> {
#> "object": "page",
#> "id": "34033ea0-c1e4-81c4-afa0-d1ec98de4bec"
#> }
#> ],
#> "next_cursor": {},
#> "has_more": false,
#> "type": "page",
#> "page": {},
#> "request_id": "ae56e2b0-35d2-407c-9622-687618c03bb5"
#> }
# ----- Delete a view query
notion$views$queries$delete(
"34033ea0-c1e4-8192-ac14-000cdad096ce",
"9af03bd1-ed79-4842-a57c-0bc04fb61be2"
)
#> {
#> "object": "view_query",
#> "id": "9af03bd1-ed79-4842-a57c-0bc04fb61be2",
#> "deleted": true,
#> "request_id": "ce52ec95-7257-4372-b08f-0fca3da2e0f1"
#> }
