Global flags
Available on every command.Environment variables
Authentication
Workers
Commands for managing Notion Workers. Most commands that target a specific worker resolve the worker ID in this order:- The
--worker-idflag (or positional<worker-id>argument). - The
workerIdfield inworkers.jsonin the current directory.
Common flags
Supported across mostworkers subcommands.
Commands
Workers — sync
Manage scheduled syncable capabilities. Each subcommand takes a<key> identifying the capability. See the Syncs guide for usage patterns, pagination, and scheduling.
The Workers common flags (--json, --plain, --worker-id) apply to every sync subcommand.
Workers — databases
Manage a worker’s declared databases and their bindings to existing Notion databases. See Attach an existing database for usage and safety guidance — attaching can overwrite or delete rows in the target database, andattach/detach both prompt for confirmation before making any change.
The Workers common flags (--json, --plain, --worker-id) apply to every databases subcommand.
Workers — env
Manage encrypted environment variables for a worker. Values are write-only; they are never returned bylist. See the Secrets guide for usage patterns and local development workflows.
Workers — OAuth
Manage OAuth connections for capabilities that authenticate against external providers. See the OAuth guide for the full setup flow.Workers — runs
Workers — webhooks
See the Webhooks guide for defining webhook handlers, request verification, and retries.API
Data sources
ntn datasources query <data-source-id>
Query pages in a data source.
Flags:
--limit <n>: page size, default25.--start-cursor <cursor>: pagination cursor from a previous response.-s, --sort <spec>:<property> [asc|desc], repeatable.--filter <json>: raw filter JSON. See Filter data source entries for the expected shape.--filter-file <path>: read filter JSON from a file; pass-for stdin.--notion-version <version>: also settable viaNOTION_API_VERSION.
ntn datasources resolve <database-id>
Resolve a Notion database ID to its data source IDs.
Flags:
--notion-version <version>: also settable viaNOTION_API_VERSION.