Skip to main content

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:
  1. The --worker-id flag (or positional <worker-id> argument).
  2. The workerId field in workers.json in the current directory.
If neither is set, the command exits with an error.

Common flags

Supported across most workers 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, and attach/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 by list. 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, default 25.
  • --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 via NOTION_API_VERSION.

ntn datasources resolve <database-id>

Resolve a Notion database ID to its data source IDs. Flags:
  • --notion-version <version>: also settable via NOTION_API_VERSION.

Pages

Files

Diagnostics