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.
Each email in the JSON array supports the same fields as
resend emails send, including per-email scheduled_at (natural language or ISO 8601) and tags. The attachments field is not supported in batch sends.
emails.json
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.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
Inboxes
Create and manage inboxes, and read, reply to, and organize the email threads they receive. Every flag below uses kebab-case, for example--inbox-id. Commands that act on an inbox, thread, email, draft, or label also accept the IDs as positional arguments, in that order, so resend inboxes threads get --inbox-id <id> --thread-id <id> and resend inboxes threads get <inbox-id> <thread-id> are the same. Run any command with --help for the full list of flags.
resend inboxes create
Create an inbox at one of your verified domains.
The domain must have receiving enabled, unless you pass
--forwarding. With --forwarding, run resend inboxes get <id> to read the receiving_address.
Other inbox commands
Threads
Received emails are grouped into threads. Every thread command takes--inbox-id.
list and search:
threads search also accepts --query, --from, --to, --cc, --bcc, --has-attachment, --without-attachment, --start-date, and --end-date. Search can be up to about a minute behind new emails.
Flags for update:
threads update needs --read, --unread, or --folder. To change a thread’s labels, use the thread labels commands.
threads delete moves the thread to trash and schedules it for deletion in 30 days. To restore it, move it to another folder with threads update --folder.
Thread emails
Read, reply to, and forward the individual emails in a thread.
*
reply requires --text or --html. forward requires --to.
Labels
Organize threads with labels. Apply or remove them with the thread labels commands.Thread labels
Change the labels on a thread. Every command takes--inbox-id and --thread-id, and prints every label on the thread after the change.
*
add and set require --labels. remove requires --label-id. Pass --labels "" to set to remove every label from the thread. Removing a label from a thread does not delete the label.
Drafts
Create unsent emails in an inbox, then send them later.--thread-id and --reply-to-email-id together. When you omit --to, the draft is addressed to the sender of the email it replies to, or to its Reply-To address. If the inbox sent that email, it is addressed to that email’s recipients instead. --cc and --bcc are never filled in. If you omit --subject, the draft is sent with the subject of the thread, prefixed with Re:. An email can have only one unsent reply draft, and creating a second one returns the existing draft.
drafts send requires the draft to have at least one recipient, a subject, and a text or HTML body.
Agent
Configure the instructions, tone, and actions for an inbox’s agent.agent update needs at least one flag. Omitted fields keep their current value. Pass --instructions "" or --tone "" to clear a value. List several actions separated by spaces or commas, for example --actions draft_reply add_labels. Pass --actions "" to disable all actions.
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.