Direct mail for growth teams, with an API underneath. Read the docs →

Direct mail API for Grok

Direct mail API for Grok: copy Mailr's skill into .grok/skills, ask Grok Build to mail a postcard when something happens in your app, and it writes the request, the trigger and a test against a free key.

What to mail from Grok

When this happensMail this
A customer's first order shipsA thank-you postcard with a code for the next order. (First-order thank you)
A card payment fails twiceA plain billing letter after the emails didn't work. (Failed payment)
A customer hasn't ordered in 90 daysA win-back postcard with an offer. (Win-back)

Set it up

  1. Install Grok Build. Run the installer from xAI, then start grok in your repo. It signs in with your X account or an xAI API key on first run.
  2. Add the skill. Download https://mailr.dev/downloads/mailr-kit.zip and copy skills/mailr-direct-mail into .grok/skills/ in your repo, or ~/.grok/skills/ for every project. Grok Build also reads Claude Code skills, so a repo already set up for Claude Code works as it is.
  3. Add your test key. Create a test key in the dashboard (Developers) and put it in .env as MAILR_API_KEY. Test pieces are free and never print.
  4. Ask for the feature. Type /mailr-direct-mail and say what should trigger mail and what it should say. The skill tells Grok to build against the test key, send an Idempotency-Key and save the piece id on the record.
  5. Go live. The test piece moves through every status in about 8 minutes. Add funds, swap in the live key, and the same code prints and mails.

Set up Grok Build

curl -fsSL https://x.ai/cli/install.sh | bash
curl -LO https://mailr.dev/downloads/mailr-kit.zip
unzip mailr-kit.zip
mkdir -p .grok/skills && cp -r mailr-kit/skills/mailr-direct-mail .grok/skills/
grok inspect   # lists the skills Grok found
  • Grok Build loads skills from .grok/skills in the project, ~/.grok/skills and ~/.agents/skills. Run grok inspect to see what it found.
  • It reads AGENTS.md and CLAUDE.md too, so a line like "mail through Mailr, never commit MAILR_API_KEY" there applies to every task.
  • Keep MAILR_API_KEY out of the repo; the skill tells the agent to read it from the environment.

What it costs

Each live piece is paid from your Mailr balance, printing and postage included: a 4x6 postcard is $0.85, a 6x9 $0.89 and an 8.5x11 letter $0.95 on pay as you go, less on a plan. Test pieces are free. All prices.

Templates that fit: First-order thank you (6x9), Failed payment (8.5x11), Win-back (6x11).

Questions

Does Mailr have an MCP server?

Not yet. Grok Build works through the REST API, guided by the skill file in the template kit and https://mailr.dev/llms.txt.

Can Grok design the postcard too?

Yes. The skill gives it the page size with bleed, the safe area and the address block for every size, so it can write front and back HTML that passes the pre-print check.

Do I need a separate skill for Grok and Claude Code?

No. It's the same SKILL.md. Grok Build reads its own .grok/skills folder and Claude Code skills, so one copy can serve both.

What does a test cost?

Nothing. Test keys never print or charge. Live postcards start at $0.85 with postage.

The code on this page is written against the Mailr API as it works today. Test it with your test key first; nothing prints until you use a live key.
GROK

Mail from Grok today

Get a free test key, send one postcard to yourself and watch it move through every status.

  • Postcards, flats and folded mailers
  • A proof before anything prints
  • Free test mode: nothing prints, nothing charges
  • A status for every piece

Download the template kit?

mailr-kit.zip · about 310 KB · 65 text files

Only HTML, JSON and Markdown files. No programs, scripts or macros, nothing that installs or runs.