> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brew.new/llms.txt
> Use this file to discover all available pages before exploring further.

# Common Flows

> Copy-runnable brew-cli sequences for the things teams do most: launch a campaign, QA a design, build a welcome automation, import contacts, and report on performance.

Every flow below is a real sequence you can paste and adapt. Ids in the examples (`eml_...`, `aud_...`, `snd_...`) come from the output of the previous command, and every command supports `--json` when you want the raw payload.

## Launch a Campaign End to End

From an empty brand to a scheduled send, with a safety check in the middle.

```bash theme={null}
# 1. Get contacts in
brew-cli contacts import-csv --file subscribers.csv --mapping "Email=email" --mapping "First Name=firstName"

# 2. Segment them
brew-cli audiences create --name "Newsletter" \
  --input '{"filters":{"filters":[{"field":"subscribed","operator":"equals","value":true}],"logicalOperator":"and"}}'

# 3. Generate the design with AI (30 to 90 seconds)
brew-cli emails generate --prompt "October product newsletter: three updates, one CTA to the changelog"

# 4. Send yourself a test before anything real happens
brew-cli emails send eml_abc123 --test --to you@yourcompany.com --subject "October newsletter preview"

# 5. Schedule the real send (the CLI asks you to confirm)
brew-cli emails send eml_abc123 --subject "What's new in October" \
  --audience aud_def456 --domain dom_ghi789 --schedule-at 2026-10-01T14:00:00Z

# 6. Watch it, or change your mind
brew-cli analytics sends get snd_jkl012
brew-cli sends cancel snd_jkl012
```

Sending needs a [verified sending domain](/get-started/verify-your-sending-domain); `brew-cli domains list` shows which of yours are ready.

## QA a Design Before a Big Send

```bash theme={null}
# Read the design and its version history
brew-cli emails get eml_abc123 --include html,versions

# Tweak it with AI and keep iterating
brew-cli emails edit eml_abc123 --prompt "Tighten the intro to two sentences"

# Accessibility audit and real-client rendering
brew-cli emails audit-accessibility eml_abc123
brew-cli emails preview-clients eml_abc123

# Where does it land: inbox or spam?
brew-cli emails create-inbox-placement-test eml_abc123 --domain dom_ghi789
brew-cli emails get-inbox-placement-results eml_abc123 --test-id ibp_xyz
```

If a revision goes wrong, `brew-cli emails restore eml_abc123 --to-version 2` brings back any earlier version as the new latest.

## Build a Welcome Automation

Mint a trigger contract, attach an automation to it, publish, and fire it from anywhere (your backend, a webhook worker, or the CLI itself).

```bash theme={null}
# 1. Define the event your systems will send. Every payload needs an email field.
brew-cli automations triggers create --title "User signed up" \
  --input '{"payloadSchema":{"type":"object","fields":[{"key":"email","type":"string","required":true},{"key":"plan","type":"string","required":false}]}}'

# 2. Create the automation graph: trigger, then send
brew-cli automations create --input '{
  "name": "Welcome flow",
  "triggerEventId": "tev_abc123",
  "nodes": [
    {"id":"t1","label":"Signup","type":"trigger","config":{"mode":"event","triggerEventId":"tev_abc123"}},
    {"id":"s1","label":"Welcome email","type":"sendEmail","config":{"emailId":"eml_abc123","emailVersionId":"emv_def456","domainId":"dom_ghi789","subject":"Welcome aboard","previewText":"Here is how to get started"}}
  ],
  "connections": [{"from":"t1","to":"s1"}]
}'

# 3. Test it safely (no real mail), then arm it
brew-cli automations test aut_jkl012 --input '{"payload":{"email":"qa@yourcompany.com"}}'
brew-cli automations publish aut_jkl012

# 4. Fire the event and watch the run
brew-cli automations triggers fire tev_abc123 --input '{"payload":{"email":"jane@example.com","plan":"pro"}}'
brew-cli automations runs list --limit 5
```

`brew-cli automations unpublish aut_jkl012` stops new runs at any time.

## Keep Your Contact Base Healthy

```bash theme={null}
# Add or update one contact with custom fields
brew-cli contacts upsert --email jane@example.com --first-name Jane --custom plan=pro

# Define a reusable custom field
brew-cli fields create --name lifecycleStage --type string

# Check deliverability before you send to a cold list
brew-cli contacts validate --emails jane@example.com bob@example.com

# Find who you are about to email
brew-cli contacts search --audience aud_def456 --limit 20
brew-cli contacts count --filter email:contains:@acme.com
```

## Report on Performance

```bash theme={null}
# The account at a glance for a date range
brew-cli analytics overview --since 2026-08-01T00:00:00Z --until 2026-09-01T00:00:00Z

# Per-send results, with the per-recipient event feed
brew-cli analytics sends get snd_jkl012 --include events

# One recipient's whole history
brew-cli analytics events --recipient jane@example.com --all
```

JSON mode makes reporting scriptable. For example, open rate by send:

```bash theme={null}
brew-cli analytics campaigns --json | jq -r '.data[] | "\(.title): \(.opened)/\(.sent)"'
```

## Explore Anything Else

```bash theme={null}
# Every command, flag, and example
brew-cli docs --agent

# The live API catalog
brew-cli docs api

# Raw access for anything without a dedicated command yet
brew-cli api GET '/v1/analytics/trigger-instances?limit=5'
```

## Need Help?

Our team is ready to support you at every step of your journey with Brew. Choose the option that works best for you:

<Tabs>
  <Tab title="Self-Service Tools">
    <CardGroup cols="2">
      <Card title="Search Documentation" icon="magnifying-glass" color="#c44925">
        Type in the "Ask any question" search bar at the top left to instantly find relevant documentation pages.
      </Card>

      <Card title="ChatGPT/Claude Integration" icon="robot" color="#c44925">
        Click "Open in ChatGPT" at the top right of any page to explore it further with ChatGPT or Claude.
      </Card>
    </CardGroup>
  </Tab>

  <Tab title="Talk to Our Team">
    <CardGroup cols="2">
      <Card title="Schedule a Call" icon="calendar" color="#c44925" href="https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ1iYoRUG1J792XQpbuQLjSRRDupr7MwraFK-HQRCtTYdBmrQi8nZu2qXfzKQigb8gbKJK3KN3-R">
        Book time with our founders for personalized guidance on strategy, best practices, or complex implementation questions.
      </Card>

      <Card title="Call Us Directly" icon="phone" color="#c44925">
        Need immediate assistance? Reach us at **+1-(332)-203-2145** for urgent issues or time-sensitive questions.
      </Card>

      <Card title="Slack Channel" icon="slack" color="#c44925">
        Our preferred support channel. You'll receive an invite after signup for direct founder support and fast responses.
      </Card>

      <Card title="Email Support" icon="envelope" color="#c44925" href="mailto:support@brew.new">
        Contact us at **[support@brew.new](mailto:support@brew.new)** for detailed inquiries or if you prefer not to use Slack.
      </Card>
    </CardGroup>
  </Tab>
</Tabs>
