Sendry Docs
Integrations

Sendry CLI

Send email, manage domains, contacts, and campaigns from your terminal with the official `sendry` command-line client.

sendry-cli is the official command-line interface for the Sendry API. It ships as a single npm package (sendry-cli) that installs a sendry binary on your PATH and mirrors the REST API one-for-one.

Install

npm install -g sendry-cli
# or
bun add -g sendry-cli

Verify the install:

sendry --version
sendry --help

Authenticate

Run sendry login once. You will be prompted for an API key, which is then saved to your OS config directory (e.g. ~/Library/Application Support/sendry-nodejs/ on macOS).

sendry login
# Sendry API key: sn_live_abc123...

sendry whoami
# API key: sn_live_abc1…
# Source:  config

For CI/CD, skip the prompt and export the key in the environment. The env variable always wins over the saved value:

export SENDRY_API_KEY=sn_live_abc123
sendry emails list --limit 5

Log out at any time:

sendry logout

Output formats

By default the CLI prints human-readable tables. Append --json to any command to emit the raw SDK response, perfect for piping through jq:

sendry domains list --json | jq '.data[] | select(.status == "verified") | .name'

Command reference

Emails

# Send a transactional email
sendry emails send \
  --from "hello@example.com" \
  --to "user@example.com" \
  --subject "Welcome" \
  --html "<h1>Hi there</h1>"

# Or read the HTML body from a file
sendry emails send \
  --from "hello@example.com" \
  --to "user@example.com" \
  --subject "Welcome" \
  --from-file ./welcome.html

# Tag the message
sendry emails send ... --tag campaign=onboarding --tag step=welcome

# Inspect recent sends
sendry emails list --limit 25
sendry emails get em_abc123
sendry emails cancel em_abc123

Domains

sendry domains list
sendry domains create example.com   # prints DNS records to copy
sendry domains verify dom_abc123
sendry domains get dom_abc123
sendry domains delete dom_abc123

Contacts & audiences

The upsert command is idempotent — it updates the contact if one exists for the email, otherwise creates it.

sendry contacts upsert \
  --email jane@example.com \
  --first-name Jane \
  --last-name Doe \
  --audience aud_abc123

sendry contacts list --audience aud_abc123
sendry audiences create "Newsletter Subscribers"
sendry audiences list

Campaigns

sendry campaigns list
sendry campaigns get cp_abc123
sendry campaigns send cp_abc123
sendry campaigns pause cp_abc123
sendry campaigns resume cp_abc123
sendry campaigns cancel cp_abc123

Templates, segments, topics, properties

sendry templates list
sendry segments create "High-Value Users"
sendry topics create "Product Updates"
sendry topics subscribe top_abc123 user@example.com
sendry properties create --name plan --label "Plan" --type string

Webhooks & API keys

sendry webhooks list
sendry webhooks create --url https://example.com/hook --events email.delivered email.bounced

sendry apikeys list
sendry apikeys create "CI key" --scope sending_access
sendry apikeys delete key_abc123

Analytics

sendry analytics overview --days 30
sendry analytics overview --days 7 --domain dom_abc123

Tracking, exports, postmaster, DLQ

# Per-domain open/click tracking
sendry tracking get dom_abc123
sendry tracking set dom_abc123 --opens true --clicks false

# CSV exports (poll until ready, then download)
sendry exports create --resource contacts
sendry exports list
sendry exports download exp_abc123 --out contacts.csv

# Gmail Postmaster integration
sendry postmaster metrics --days 14
sendry postmaster sync

# Dead-letter queue (admin only)
sendry dlq list
sendry dlq retry job_abc123

Configuration storage

The CLI stores its config in:

  • macOS: ~/Library/Application Support/sendry-nodejs/config.json
  • Linux: ~/.config/sendry-nodejs/config.json
  • Windows: %APPDATA%\sendry-nodejs\Config\config.json

Only the API key is persisted. The SENDRY_API_KEY and SENDRY_BASE_URL environment variables override the on-disk config when set.

On this page