Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt

Use this file to discover all available pages before exploring further.

Sequenzy CLI

The Sequenzy CLI lets you manage subscribers, send emails, and view analytics directly from your terminal. It also exposes read-only localization data for companies and templates.

Installation

# Using npx (no install needed)
npx sequenzy --help

# Or install globally
npm install -g @sequenzy/cli

Authentication

Login

sequenzy login
This prints a login URL and approval code in the terminal. Open the link in any browser, approve the session, and keep the terminal open until the CLI stores your API key. This flow also works in headless or agent-driven environments where the CLI cannot launch a browser for you.

Check login status

sequenzy whoami

Logout

sequenzy logout

Commands

Subscribers

# List subscribers
sequenzy subscribers list
sequenzy subscribers list --tag vip
sequenzy subscribers list --segment active-users

# Add a subscriber
sequenzy subscribers add user@example.com
sequenzy subscribers add user@example.com --tag premium --attr name=John

# Get subscriber details
sequenzy subscribers get user@example.com

# Remove a subscriber
sequenzy subscribers remove user@example.com
sequenzy subscribers remove user@example.com --hard  # permanent delete

Send Email

Send transactional emails to single recipients:
# Using a template
sequenzy send user@example.com --template welcome --var name=John

# Using raw HTML
sequenzy send user@example.com --subject "Hello" --html "<h1>Hi!</h1>"

# From a file
sequenzy send user@example.com --subject "Report" --html-file ./email.html

Statistics

# Overview stats
sequenzy stats
sequenzy stats --period 30d

# Campaign stats
sequenzy stats --campaign camp_abc123

# Sequence stats
sequenzy stats --sequence seq_xyz789

Campaigns

# List campaigns
sequenzy campaigns list
sequenzy campaigns list --status draft

# Get campaign details
sequenzy campaigns get camp_abc123

# Update a draft campaign reply-to
sequenzy campaigns update camp_abc123 --reply-to support@example.com

# Create a draft campaign
sequenzy campaigns create "Launch" --subject "Big News!" --html-file ./launch.html
sequenzy campaigns create "Launch" --subject "Big News!" --blocks-file ./launch-blocks.json

# Send test email
sequenzy campaigns test camp_abc123 --to me@example.com
Campaigns can only be created as drafts via CLI. Schedule and send from the dashboard.
campaigns create and campaigns update accept either raw HTML or Sequenzy block JSON via --blocks-json or --blocks-file. Use block input when you need editor-compatible content or conditional blocks.

Sequences

# List sequences
sequenzy sequences list

# Get sequence details
sequenzy sequences get seq_abc123

# Enable/disable
sequenzy sequences enable seq_abc123
sequenzy sequences disable seq_abc123

Templates

# List templates
sequenzy templates list
sequenzy templates list --company comp_abc123
sequenzy templates list --json

# Get template
sequenzy templates get tmpl_abc123
sequenzy templates get tmpl_abc123 --company comp_abc123 --json

# Create or update with HTML
sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html
sequenzy templates update tmpl_abc123 --subject "Updated" --html-file ./welcome-v2.html

# Create or update with Sequenzy blocks
sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json
sequenzy templates update tmpl_abc123 --blocks-file ./welcome-v2-blocks.json
templates list includes localization sync status by locale. templates get includes the full localized variants and the effective company localization config. When you pass blocks JSON, each block can include a condition object for recipient-specific content, for example:
[
  {
    "id": "intro",
    "type": "text",
    "content": "<p>Hello there</p>",
    "variant": "paragraph"
  },
  {
    "id": "pro-offer",
    "type": "text",
    "content": "<p>Your Pro upgrade is ready.</p>",
    "variant": "paragraph",
    "condition": {
      "variable": "plan",
      "operator": "equals",
      "value": "pro"
    }
  }
]
Use merge-tag variable names without {{ }} inside condition.variable.

Companies

sequenzy companies list
sequenzy companies get comp_abc123
sequenzy companies get comp_abc123 --json
companies get includes the effective email localization settings for that company.

Segments

# List saved segments
sequenzy segments list

# Preview how many subscribers are in a segment
sequenzy segments count seg_abc123

# Create a Stripe-product segment
sequenzy segments create --name "Bought Pro" --stripe-product prod_pro

# Create a threshold-based Stripe-product segment
sequenzy segments create --name "3+ Pro Payments" \
  --stripe-product prod_pro \
  --purchase-operator at-least \
  --payments 3

# Create a segment that matches any filter instead of all filters
sequenzy segments create --name "VIP Or Gmail" \
  --match any \
  --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"email","operator":"contains","value":"@gmail.com"}]'

# Create a segment from raw filter JSON
sequenzy segments create --name "Custom Filter" \
  --filter-json '[{"field":"stripeProduct","operator":"is","value":"prod_pro"}]'

# Combine campaign-specific engagement filters (bounced A but not B)
sequenzy segments create --name "Bounced A Not B" \
  --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'

# Create a nested segment with an event filter
sequenzy segments create --name "Active Non Buyers" \
  --filter-json '{"root":{"kind":"group","joinOperator":"and","children":[{"kind":"filter","field":"attribute","operator":"lte","value":"last_login_days_ago:90"},{"kind":"group","joinOperator":"or","children":[{"kind":"filter","field":"event","operator":"is_not","value":"saas.purchase:30d"},{"kind":"filter","field":"segment","operator":"is_not","value":"seg_paying_customers"}]}]}}'
For Stripe product segments, use the Stripe product ID, not the product name. The CLI maps:
  • bought -> field: "stripeProduct", operator: "is", value: "prod_xxx"
  • didnt-buy -> field: "stripeProduct", operator: "is_not", value: "prod_xxx"
  • at-least -> field: "stripeProduct", operator: "at_least", value: "prod_xxx:3"
  • less-than -> field: "stripeProduct", operator: "less_than_count", value: "prod_xxx:3"
Engagement filters (emailSent, emailOpened, emailClicked, emailBounced, emailComplained) accept either a rolling time window (7d, 30d, 90d, 180d, all) or a specific sent campaign (campaign:<campaign_id>). Combine two campaign-specific filters with the default --match all to express rules like “bounced campaign A but not campaign B”. Look up campaign IDs with sequenzy campaigns list. --filter-json accepts the same filter shape used by the API and MCP. Pass a JSON array for legacy flat filters, or an object with a nested root group for v2 nested logic. If you omit filter or group id values, the CLI fills them in automatically. Event filters use field: "event" with values like saas.purchase:30d, saas.purchase:all, or saas.purchase:5:30d for count-based operators. Segment filters use field: "segment" with the saved segment ID as the value. By default, segments create matches all filters with AND logic. Pass --match any to save the segment with OR logic instead. segments count returns the number of active subscribers who currently match the segment. In the dashboard you may also see a broader matched-contact count, but campaigns only send to active subscribers. tags and lists are not wired into the CLI yet.

Account

sequenzy account
sequenzy account --json
sequenzy websites

AI Generation

# Generate email
sequenzy generate email "Welcome email for new SaaS trial users"
sequenzy generate email "Product launch announcement" --style branded --tone professional

# Generate sequence
sequenzy generate sequence "Onboarding for SaaS trial users"
sequenzy generate sequence "Re-engagement for inactive users" --count 3 --days 7

# Generate subject lines
sequenzy generate subjects "Black Friday sale" --count 5
Generated content is returned as draft content for review. Sequence generation supports up to 10 emails.

Environment Variables

VariableDescriptionDefault
SEQUENZY_API_URLAPI server URLhttps://api.sequenzy.com
SEQUENZY_APP_URLApp URL for authhttps://sequenzy.com

Config Location

The CLI stores configuration in:
  • macOS/Linux: ~/.config/sequenzy/config.json
  • Windows: %APPDATA%\sequenzy\config.json

Scripting

The CLI is designed to work well in scripts:
#!/bin/bash

# Import subscribers from CSV
while IFS=, read -r email name plan; do
  sequenzy subscribers add "$email" --attr "name=$name" --attr "plan=$plan"
done < subscribers.csv

# Check if logged in
if ! sequenzy whoami > /dev/null 2>&1; then
  echo "Not logged in"
  exit 1
fi

Exit Codes

CodeMeaning
0Success
1Error

Troubleshooting

CLI failures now include a short human explanation, a suggested next step, and a direct docs link so agents and scripts can recover faster.

”Not logged in”

Run sequenzy login to authenticate.

”API error: 401”

Your session may have expired. Run sequenzy login again.

Browser doesn’t open

sequenzy login always prints the approval link. Open the URL shown in the terminal to complete authentication.