Notion: Query session events
Notion sessions.querySessionEvents: arguments, response, policy and SDK examples.
← Sessions operations · Get started
Operation notion.query_session_events
Provider route: POST /v1/sessions/{session_id}/events/query. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/notion with npm, or alter-sdk-notion with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { NotionIntegration } from "@alter-ai/notion";
async function execute(input: Parameters<NotionIntegration["sessions"]["querySessionEvents"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new NotionIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.sessions.querySessionEvents(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_notion import NotionIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = NotionIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.sessions.query_session_events(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.session_id | string | Required within parent | The ID of the session whose events should be queried. |
body | object | Required within parent | Additional keys: not allowed |
body.filter | JSON | Optional | A session event property filter, or an and/or compound filter nested up to three levels deep. |
body.filter (oneOf 1) | object | Alternative | Additional keys: not allowed |
body.filter (oneOf 1).property | string | Required within parent | One of: id |
body.filter (oneOf 1).string | object | Required within parent | Additional keys: not allowed |
body.filter (oneOf 1).string.equals | string | Required within parent | |
body.filter (oneOf 2) | Model | Alternative | Expand Query session events — request body — body / filter / property: type |
body.filter (oneOf 3) | object | Alternative | Additional keys: not allowed |
body.filter (oneOf 3).number | object | Required within parent | Additional keys: not allowed |
body.filter (oneOf 3).number.greater_than | number | Optional | |
body.filter (oneOf 3).number.greater_than_or_equal_to | number | Optional | |
body.filter (oneOf 3).number.less_than | number | Optional | |
body.filter (oneOf 3).number.less_than_or_equal_to | number | Optional | |
body.filter (oneOf 3).property | string | Required within parent | One of: sequence |
body.filter (oneOf 4) | Model | Alternative | Expand Query session events — request body — body / filter / property: created at |
body.filter (oneOf 5) | object | Alternative | Additional keys: not allowed |
body.filter (oneOf 5).and | array | Required within parent | |
body.filter (oneOf 5).and[] | JSON | Each item | |
body.filter (oneOf 5).and[] (oneOf 1) | object | Alternative | Additional keys: not allowed |
body.filter (oneOf 5).and[] (oneOf 1).property | string | Required within parent | One of: id |
body.filter (oneOf 5).and[] (oneOf 1).string | object | Required within parent | Additional keys: not allowed |
body.filter (oneOf 5).and[] (oneOf 1).string.equals | string | Required within parent | |
body.filter (oneOf 5).and[] (oneOf 2) | Model | Alternative | Expand Query session events — request body — body / filter / property: type |
body.filter (oneOf 5).and[] (oneOf 3) | object | Alternative | Additional keys: not allowed |
body.filter (oneOf 5).and[] (oneOf 3).number | object | Required within parent | Additional keys: not allowed |
body.filter (oneOf 5).and[] (oneOf 3).number.greater_than | number | Optional | |
body.filter (oneOf 5).and[] (oneOf 3).number.greater_than_or_equal_to | number | Optional | |
body.filter (oneOf 5).and[] (oneOf 3).number.less_than | number | Optional | |
body.filter (oneOf 5).and[] (oneOf 3).number.less_than_or_equal_to | number | Optional | |
body.filter (oneOf 5).and[] (oneOf 3).property | string | Required within parent | One of: sequence |
body.filter (oneOf 5).and[] (oneOf 4) | Model | Alternative | Expand Query session events — request body — body / filter / property: created at |
body.filter (oneOf 5).and[] (oneOf 5) | Model | Alternative | Expand Query session events — request body — body filter or or item and |
body.filter (oneOf 5).and[] (oneOf 6) | Model | Alternative | Expand Query session events — request body — body filter or or item or |
body.filter (oneOf 6) | object | Alternative | Additional keys: not allowed |
body.filter (oneOf 6).or | array | Required within parent | |
body.filter (oneOf 6).or[] | JSON | Each item | |
body.filter (oneOf 6).or[] (oneOf 1) | object | Alternative | Additional keys: not allowed |
body.filter (oneOf 6).or[] (oneOf 1).property | string | Required within parent | One of: id |
body.filter (oneOf 6).or[] (oneOf 1).string | object | Required within parent | Additional keys: not allowed |
body.filter (oneOf 6).or[] (oneOf 1).string.equals | string | Required within parent | |
body.filter (oneOf 6).or[] (oneOf 2) | Model | Alternative | Expand Query session events — request body — body / filter / property: type |
body.filter (oneOf 6).or[] (oneOf 3) | object | Alternative | Additional keys: not allowed |
body.filter (oneOf 6).or[] (oneOf 3).number | object | Required within parent | Additional keys: not allowed |
body.filter (oneOf 6).or[] (oneOf 3).number.greater_than | number | Optional | |
body.filter (oneOf 6).or[] (oneOf 3).number.greater_than_or_equal_to | number | Optional | |
body.filter (oneOf 6).or[] (oneOf 3).number.less_than | number | Optional | |
body.filter (oneOf 6).or[] (oneOf 3).number.less_than_or_equal_to | number | Optional | |
body.filter (oneOf 6).or[] (oneOf 3).property | string | Required within parent | One of: sequence |
body.filter (oneOf 6).or[] (oneOf 4) | Model | Alternative | Expand Query session events — request body — body / filter / property: created at |
body.filter (oneOf 6).or[] (oneOf 5) | Model | Alternative | Expand Query session events — request body — body filter or or item and |
body.filter (oneOf 6).or[] (oneOf 6) | Model | Alternative | Expand Query session events — request body — body filter or or item or |
body.page_size | integer | Optional | The number of events to return. Maximum: 100. Maximum: 100 Minimum: 1 |
body.sorts | array | Optional | Ordered sort precedence. Defaults to sequence ascending. Maximum items: 2 Minimum items: 1 |
body.sorts[] | object | Each item | Additional keys: not allowed |
body.sorts[].direction | string | Required within parent | One of: `ascending`, `descending` One of: ascending, descending |
body.sorts[].property | string | Required within parent | One of: `sequence`, `created_at` One of: sequence, created_at |
body.start_cursor | string | Optional | The continuation cursor returned by the previous page. |
Referenced models: Query session events — request body — body filter or or item or, Query session events — request body — body filter or or item and, Query session events — request body — body / filter / property: created at, Query session events — request body — body / filter / property: type
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
has_more | boolean | Required within parent | |
next_cursor | JSON | Required within parent | |
next_cursor (anyOf 1) | string | Alternative | |
next_cursor (anyOf 2) | null | Alternative | |
object | string | Required within parent | Always `list` Must equal: list |
results | array | Required within parent | Maximum items: 100 |
results[] | JSON | Each item | |
results[] (anyOf 1) | object | Alternative | Additional keys: allowed |
results[] (anyOf 1).content | array | Required within parent | |
results[] (anyOf 1).content[] | JSON | Each item | |
results[] (anyOf 1).content[] (anyOf 1) | object | Alternative | Additional keys: allowed |
results[] (anyOf 1).content[] (anyOf 1).text | string | Required within parent | |
results[] (anyOf 1).content[] (anyOf 1).type | string | Required within parent | Always `text` Must equal: text |
results[] (anyOf 1).content[] (anyOf 2) | object | Alternative | Additional keys: allowed |
results[] (anyOf 1).content[] (anyOf 2).content_type | string | Required within parent | |
results[] (anyOf 1).content[] (anyOf 2).expiry_time | string | Optional | |
results[] (anyOf 1).content[] (anyOf 2).name | string | Required within parent | |
results[] (anyOf 1).content[] (anyOf 2).type | string | Required within parent | Always `file` Must equal: file |
results[] (anyOf 1).content[] (anyOf 2).url | string | Required within parent | |
results[] (anyOf 1).created_at | string | Required within parent | |
results[] (anyOf 1).created_by | JSON | Required within parent | |
results[] (anyOf 1).created_by (anyOf 1) | object | Alternative | Additional keys: allowed |
results[] (anyOf 1).created_by (anyOf 1).id | string | Required within parent | |
results[] (anyOf 1).created_by (anyOf 1).type | string | Required within parent | One of: `user`, `bot` Known values: user, bot |
results[] (anyOf 1).created_by (anyOf 2) | null | Alternative | |
results[] (anyOf 1).id | string | Required within parent | |
results[] (anyOf 1).metadata | JSON | Required within parent | |
results[] (anyOf 1).metadata (anyOf 1) | object | Alternative | Additional keys: see wildcard field |
results[] (anyOf 1).metadata (anyOf 1).* | string | Additional keys | Maximum length: 2000 |
results[] (anyOf 1).metadata (anyOf 2) | null | Alternative | |
results[] (anyOf 1).object | string | Required within parent | Always `session_event` Must equal: session_event |
results[] (anyOf 1).sequence | JSON | Required within parent | |
results[] (anyOf 1).sequence (anyOf 1) | integer | Alternative | Minimum: 1 |
results[] (anyOf 1).sequence (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
results[] (anyOf 1).session_id | string | Required within parent | |
results[] (anyOf 1).type | string | Required within parent | Always `user.message` Must equal: user.message |
results[] (anyOf 2) | object | Alternative | Additional keys: allowed |
results[] (anyOf 2).content | array | Required within parent | |
results[] (anyOf 2).content[] | JSON | Each item | |
results[] (anyOf 2).content[] (anyOf 1) | object | Alternative | Additional keys: allowed |
results[] (anyOf 2).content[] (anyOf 1).text | string | Required within parent | |
results[] (anyOf 2).content[] (anyOf 1).type | string | Required within parent | Always `text` Must equal: text |
results[] (anyOf 2).content[] (anyOf 2) | object | Alternative | Additional keys: allowed |
results[] (anyOf 2).content[] (anyOf 2).content_type | string | Required within parent | |
results[] (anyOf 2).content[] (anyOf 2).expiry_time | string | Optional | |
results[] (anyOf 2).content[] (anyOf 2).name | string | Required within parent | |
results[] (anyOf 2).content[] (anyOf 2).type | string | Required within parent | Always `file` Must equal: file |
results[] (anyOf 2).content[] (anyOf 2).url | string | Required within parent | |
results[] (anyOf 2).created_at | string | Required within parent | |
results[] (anyOf 2).created_by | JSON | Required within parent | |
results[] (anyOf 2).created_by (anyOf 1) | object | Alternative | Additional keys: allowed |
results[] (anyOf 2).created_by (anyOf 1).id | string | Required within parent | |
results[] (anyOf 2).created_by (anyOf 1).type | string | Required within parent | One of: `user`, `bot` Known values: user, bot |
results[] (anyOf 2).created_by (anyOf 2) | null | Alternative | |
results[] (anyOf 2).id | string | Required within parent | |
results[] (anyOf 2).metadata | JSON | Required within parent | |
results[] (anyOf 2).metadata (anyOf 1) | object | Alternative | Additional keys: allowed |
results[] (anyOf 2).metadata (anyOf 1).model | string | Required within parent | |
results[] (anyOf 2).metadata (anyOf 2) | null | Alternative | |
results[] (anyOf 2).object | string | Required within parent | Always `session_event` Must equal: session_event |
results[] (anyOf 2).sequence | JSON | Required within parent | |
results[] (anyOf 2).sequence (anyOf 1) | integer | Alternative | Minimum: 1 |
results[] (anyOf 2).sequence (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
results[] (anyOf 2).session_id | string | Required within parent | |
results[] (anyOf 2).type | string | Required within parent | Always `agent.message` Must equal: agent.message |
results[] (anyOf 3) | object | Alternative | Additional keys: allowed |
results[] (anyOf 3).content | array | Required within parent | |
results[] (anyOf 3).content[] | object | Each item | Additional keys: allowed |
results[] (anyOf 3).content[].text | string | Required within parent | |
results[] (anyOf 3).content[].type | string | Required within parent | Always `text` Must equal: text |
results[] (anyOf 3).created_at | string | Required within parent | |
results[] (anyOf 3).id | string | Required within parent | |
results[] (anyOf 3).object | string | Required within parent | Always `session_event` Must equal: session_event |
results[] (anyOf 3).sequence | JSON | Required within parent | |
results[] (anyOf 3).sequence (anyOf 1) | integer | Alternative | Minimum: 1 |
results[] (anyOf 3).sequence (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
results[] (anyOf 3).session_id | string | Required within parent | |
results[] (anyOf 3).type | string | Required within parent | Always `agent.thinking` Must equal: agent.thinking |
results[] (anyOf 4) | object | Alternative | Additional keys: allowed |
results[] (anyOf 4).created_at | string | Required within parent | |
results[] (anyOf 4).id | string | Required within parent | |
results[] (anyOf 4).object | string | Required within parent | Always `session_event` Must equal: session_event |
results[] (anyOf 4).sequence | JSON | Required within parent | |
results[] (anyOf 4).sequence (anyOf 1) | integer | Alternative | Minimum: 1 |
results[] (anyOf 4).sequence (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
results[] (anyOf 4).session_id | string | Required within parent | |
results[] (anyOf 4).tool_name | string | Required within parent | |
results[] (anyOf 4).type | string | Required within parent | Always `agent.tool_use` Must equal: agent.tool_use |
results[] (anyOf 5) | object | Alternative | Additional keys: allowed |
results[] (anyOf 5).created_at | string | Required within parent | |
results[] (anyOf 5).id | string | Required within parent | |
results[] (anyOf 5).is_error | boolean | Required within parent | |
results[] (anyOf 5).object | string | Required within parent | Always `session_event` Must equal: session_event |
results[] (anyOf 5).sequence | JSON | Required within parent | |
results[] (anyOf 5).sequence (anyOf 1) | integer | Alternative | Minimum: 1 |
results[] (anyOf 5).sequence (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
results[] (anyOf 5).session_id | string | Required within parent | |
results[] (anyOf 5).tool_name | string | Required within parent | |
results[] (anyOf 5).tool_use_id | string | Required within parent | |
results[] (anyOf 5).type | string | Required within parent | Always `agent.tool_result` Must equal: agent.tool_result |
results[] (anyOf 6) | object | Alternative | Additional keys: allowed |
results[] (anyOf 6).created_at | string | Required within parent | |
results[] (anyOf 6).error | object | Optional | Additional keys: allowed |
results[] (anyOf 6).error.code | string | Required within parent | |
results[] (anyOf 6).error.message | string | Required within parent | |
results[] (anyOf 6).error.retryable | boolean | Required within parent | |
results[] (anyOf 6).id | string | Required within parent | |
results[] (anyOf 6).object | string | Required within parent | Always `session_event` Must equal: session_event |
results[] (anyOf 6).required_actions | array | Optional | |
results[] (anyOf 6).required_actions[] | object | Each item | Additional keys: allowed |
results[] (anyOf 6).required_actions[].action_id | string | Required within parent | |
results[] (anyOf 6).required_actions[].options | array | Required within parent | Maximum items: 100 |
results[] (anyOf 6).required_actions[].options[] | object | Each item | Additional keys: allowed |
results[] (anyOf 6).required_actions[].options[].id | string | Required within parent | One of: `approve`, `reject` Known values: approve, reject |
results[] (anyOf 6).required_actions[].options[].label | string | Required within parent | |
results[] (anyOf 6).required_actions[].title | string | Required within parent | |
results[] (anyOf 6).sequence | JSON | Required within parent | |
results[] (anyOf 6).sequence (anyOf 1) | integer | Alternative | Minimum: 1 |
results[] (anyOf 6).sequence (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
results[] (anyOf 6).session_id | string | Required within parent | |
results[] (anyOf 6).status | string | Required within parent | One of: `requires_action`, `completed`, `failed`, `canceled`, `terminated` Known values: requires_action, completed, failed, canceled, terminated |
results[] (anyOf 6).type | string | Required within parent | Always `session.status` Must equal: session.status |
session_event | object | Required within parent | Additional keys: allowed |
type | string | Required within parent | Always `session_event` Must equal: session_event |
Schemas
Section titled “Schemas”Query session events — request body — body filter or or item or
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
or | array | Required within parent | |
or[] | JSON | Each item | |
or[] (oneOf 1) | object | Alternative | Additional keys: not allowed |
or[] (oneOf 1).property | string | Required within parent | One of: id |
or[] (oneOf 1).string | object | Required within parent | Additional keys: not allowed |
or[] (oneOf 1).string.equals | string | Required within parent | |
or[] (oneOf 2) | Model | Alternative | Expand Query session events — request body — body / filter / property: type |
or[] (oneOf 3) | object | Alternative | Additional keys: not allowed |
or[] (oneOf 3).number | object | Required within parent | Additional keys: not allowed |
or[] (oneOf 3).number.greater_than | number | Optional | |
or[] (oneOf 3).number.greater_than_or_equal_to | number | Optional | |
or[] (oneOf 3).number.less_than | number | Optional | |
or[] (oneOf 3).number.less_than_or_equal_to | number | Optional | |
or[] (oneOf 3).property | string | Required within parent | One of: sequence |
or[] (oneOf 4) | Model | Alternative | Expand Query session events — request body — body / filter / property: created at |
or[] (oneOf 5) | Model | Alternative | Expand Query session events — request body — body filter or or item or or item and |
or[] (oneOf 6) | Model | Alternative | Expand Query session events — request body — body filter or or item or or item or |
Referenced models: Query session events — request body — body filter or or item or or item and, Query session events — request body — body filter or or item or or item or, Query session events — request body — body / filter / property: created at, Query session events — request body — body / filter / property: type
Query session events — request body — body filter or or item and
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
and | array | Required within parent | |
and[] | JSON | Each item | |
and[] (oneOf 1) | object | Alternative | Additional keys: not allowed |
and[] (oneOf 1).property | string | Required within parent | One of: id |
and[] (oneOf 1).string | object | Required within parent | Additional keys: not allowed |
and[] (oneOf 1).string.equals | string | Required within parent | |
and[] (oneOf 2) | Model | Alternative | Expand Query session events — request body — body / filter / property: type |
and[] (oneOf 3) | object | Alternative | Additional keys: not allowed |
and[] (oneOf 3).number | object | Required within parent | Additional keys: not allowed |
and[] (oneOf 3).number.greater_than | number | Optional | |
and[] (oneOf 3).number.greater_than_or_equal_to | number | Optional | |
and[] (oneOf 3).number.less_than | number | Optional | |
and[] (oneOf 3).number.less_than_or_equal_to | number | Optional | |
and[] (oneOf 3).property | string | Required within parent | One of: sequence |
and[] (oneOf 4) | Model | Alternative | Expand Query session events — request body — body / filter / property: created at |
and[] (oneOf 5) | Model | Alternative | Expand Query session events — request body — body filter or or item or or item and |
and[] (oneOf 6) | Model | Alternative | Expand Query session events — request body — body filter or or item or or item or |
Referenced models: Query session events — request body — body filter or or item or or item and, Query session events — request body — body filter or or item or or item or, Query session events — request body — body / filter / property: created at, Query session events — request body — body / filter / property: type
Query session events — request body — body / filter / property: created at
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
property | string | Required within parent | One of: created_at |
timestamp | object | Required within parent | Additional keys: not allowed |
timestamp.after | string | Optional | Format: date-time |
timestamp.before | string | Optional | Format: date-time |
timestamp.equals | string | Optional | Format: date-time |
timestamp.on_or_after | string | Optional | Format: date-time |
timestamp.on_or_before | string | Optional | Format: date-time |
Query session events — request body — body / filter / property: type
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
event_type | object | Required within parent | Additional keys: not allowed |
event_type.equals | string | Optional | One of: user.message, agent.message, agent.thinking, agent.tool_use, agent.tool_result, session.status |
event_type.in | array | Optional | |
event_type.in[] | string | Each item | One of: user.message, agent.message, agent.thinking, agent.tool_use, agent.tool_result, session.status |
property | string | Required within parent | One of: type |
Query session events — request body — body filter or or item or or item and
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
and | array | Required within parent | |
and[] | JSON | Each item | |
and[] (oneOf 1) | object | Alternative | Additional keys: not allowed |
and[] (oneOf 1).property | string | Required within parent | One of: id |
and[] (oneOf 1).string | object | Required within parent | Additional keys: not allowed |
and[] (oneOf 1).string.equals | string | Required within parent | |
and[] (oneOf 2) | Model | Alternative | Expand Query session events — request body — body / filter / property: type |
and[] (oneOf 3) | object | Alternative | Additional keys: not allowed |
and[] (oneOf 3).number | object | Required within parent | Additional keys: not allowed |
and[] (oneOf 3).number.greater_than | number | Optional | |
and[] (oneOf 3).number.greater_than_or_equal_to | number | Optional | |
and[] (oneOf 3).number.less_than | number | Optional | |
and[] (oneOf 3).number.less_than_or_equal_to | number | Optional | |
and[] (oneOf 3).property | string | Required within parent | One of: sequence |
and[] (oneOf 4) | Model | Alternative | Expand Query session events — request body — body / filter / property: created at |
Referenced models: Query session events — request body — body / filter / property: created at, Query session events — request body — body / filter / property: type
Query session events — request body — body filter or or item or or item or
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
or | array | Required within parent | |
or[] | JSON | Each item | |
or[] (oneOf 1) | object | Alternative | Additional keys: not allowed |
or[] (oneOf 1).property | string | Required within parent | One of: id |
or[] (oneOf 1).string | object | Required within parent | Additional keys: not allowed |
or[] (oneOf 1).string.equals | string | Required within parent | |
or[] (oneOf 2) | Model | Alternative | Expand Query session events — request body — body / filter / property: type |
or[] (oneOf 3) | object | Alternative | Additional keys: not allowed |
or[] (oneOf 3).number | object | Required within parent | Additional keys: not allowed |
or[] (oneOf 3).number.greater_than | number | Optional | |
or[] (oneOf 3).number.greater_than_or_equal_to | number | Optional | |
or[] (oneOf 3).number.less_than | number | Optional | |
or[] (oneOf 3).number.less_than_or_equal_to | number | Optional | |
or[] (oneOf 3).property | string | Required within parent | One of: sequence |
or[] (oneOf 4) | Model | Alternative | Expand Query session events — request body — body / filter / property: created at |
Referenced models: Query session events — request body — body / filter / property: created at, Query session events — request body — body / filter / property: type
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: notion.query_session_events. Catalog operation: query_session_events. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Pinned headers: {"Notion-Version": "2026-03-11"}