Installation
- cURL
- npm
- Homebrew
- PowerShell (Windows)
Authentication
The CLI resolves your API key using the following priority chain:
If no key is found from any source, the CLI errors with code
auth_error.
resend login
Authenticate by storing your API key locally. The key is validated against the Resend API before being saved.
--key flag:
resend logout
Remove your saved API key.
--profile flag on any command to run it with a specific profile:
Emails
Send, retrieve, cancel, and manage email delivery.resend emails send
Send an email. Provide all options via flags for scripting, or let the CLI prompt interactively for missing fields.
* Not required when using
--template, which provides them.
Examples:
resend emails batch
Send up to 100 emails in a single API request from a JSON file.
Other email commands
Receiving
Process inbound emails, download attachments, and stream incoming messages.Domains
Manage your sending and receiving domains.API Keys
Create, list, and revoke API keys for programmatic access.Broadcasts
Create and send broadcast emails to segments.Contacts
Manage contacts, segment membership, and topic subscriptions.resend contacts imports create
Start an asynchronous CSV import. The command uploads the file and returns a
contact import ID immediately. Use resend contacts imports get <id> to check
processing status.
Without
--column-map, CSV headers must match the lowercase contact field
names exactly: email, first_name, and last_name. Use --column-map when
your CSV uses headers like Email or First Name.
resend contacts imports get
Retrieve a contact import by ID, including status and row counts.
resend contacts imports list
List contact imports. The default limit is 10.
Contact Properties
Define custom properties to store additional data on contacts.Segments
Group contacts into targetable segments for broadcasts.Topics
Manage subscription topics that contacts can opt in or out of.Suppressions
Manage the suppression list — addresses that won’t receive your emails. Each entry has anorigin: bounce and complaint are added automatically, while manual entries are the ones you add. get and delete accept either a suppression ID or the email address.
Templates
Create and manage email templates.Logs
View API request logs.Webhooks
Register endpoints and listen for email event notifications.resend webhooks create
Register a webhook endpoint.
resend webhooks listen
Listen for webhook events locally during development. Starts a server, registers a temporary webhook, streams events, and cleans up on exit.
See the webhook events documentation for the full
list of available event types. For agent-specific webhook patterns, see CLI
for AI Agents.
Automations
Create, manage, and monitor event-driven automation workflows.resend automations create
Create a new automation from a JSON file describing the workflow graph.
* Provide
--file, or --name with --steps and --connections. When using --file, other flags override file values.
Other automation commands
Events
Define and send events that trigger automations.resend events send
Send an event to trigger matching automations for a contact.
Other event commands
Utility
Diagnose your setup, manage authentication, and configure shell completions.resend doctor
Run environment diagnostics. Verifies your CLI version, API key, credential storage, and domain status.
0 when all checks pass or warn. Exits 1 if any check fails.
Other utility commands
Global options
These flags work on every command:Output behavior
The CLI has two output modes that switch automatically:
Pipe to another command and JSON output activates:
1 and output structured JSON:
CI/CD
SetRESEND_API_KEY as an environment variable, with no resend login needed:
Configuration
Using the CLI with AI Agents
Learn about Agent Skills, non-interactive mode, and local webhook development
for AI agents.