PapermarkDocs

CLI

The `papermark` command — scripted workflows, CI, and local exploration.

papermark is the official command-line client. It wraps the same REST API the dashboard uses, with first-class support for piping, machine-readable output, and CI environments.

npm install -g papermark
papermark login
papermark documents list

When to use it (and when not to)

Use the CLIUse the API directly
One-off scripts, cron jobs, CI tasksA backend service in your stack
Scripted dataroom population for customersA web UI you control
Per-customer link minting in a CRM workflowA worker fleet running thousands of QPS
Local exploration ("what's in this dataroom?")Anything performance-sensitive
Ad-hoc analytics pulls (--json then jq)

The CLI shells out to your local Node, so per-call overhead is on the order of 50–150 ms. Fine for scripts, not great for hot paths.

Command tree

GroupPurpose
papermark login / logout / whoamiAuth lifecycle
papermark auth export / auth setMove credentials between machines
papermark documentsList, get, search, upload, delete documents
papermark dataroomsCreate, list, configure datarooms; read viewers and aggregate analytics
papermark linksCreate, list, get, delete share links (document- or dataroom-bound)
papermark viewsRead view analytics for a link
papermark configPer-machine settings (e.g. API URL override)
papermark doctorHealth checks: config, token, API reachability

Run any command with --help for the full flag list. The Commands page has per-command pages with examples.

Global flags

These work on every command:

FlagEffect
--jsonForce machine-readable JSON output. Auto-enabled when stdout is not a TTY (i.e., when piped).
--dry-runPrint the HTTP request that would be sent (with the token redacted) and exit 0. Useful for debugging permissions and request shapes.
--no-colorDisable ANSI color. Equivalent to NO_COLOR=1.

Output is a contract

When you pass --json (or pipe to anything), the CLI emits a stable envelope:

{ "ok": true, "data": {  }, "meta": { "next_cursor": "…" } }

On failure:

{
  "ok": false,
  "error": {
    "code": "AUTH_INVALID",
    "message": "Token rejected.",
    "status": 401,
    "retryable": false,
    "doc_url": "https://papermark.com/docs/cli/output-contract#auth-invalid"
  }
}

Exit codes are tied to the error class — 2 for auth, 3 for validation, 4 for network, 1 for everything else, 5 for an internal CLI bug. See the output contract for the full table.

Next

On this page