CLI
wemail on the command line — the wemail-mcp CLI is available today; a full-featured wemail CLI is on the roadmap.
bashwemail-mcp — install into every detected client
# One command wires the server into your MCP clients with your API key:
npx -y wemail-mcp install --api-key afn_live_xxx
# Or run the server directly (clients usually launch this for you):
WEMAIL_API_KEY=afn_live_xxx npx -y wemail-mcpSee the MCP servers page for the full tool list, per-client setup and the hosted endpoint (https://mcp.wemail.io/mcp).
Roadmap: a full wemail CLI
A general-purpose wemail CLI — send test mail, tail event logs and manage API keys and domains straight from the terminal — is on our roadmap. Until it ships, the wemail-mcp tool above, the REST API and the official SDKs cover every operation. Planned usage:
bashPlanned — not yet available
wemail login
wemail send --to alex@example.com --subject "ping" --html "<p>hi</p>"
wemail events tail --tag welcomeWant early access when it lands? Email support@wemail.io.
Code examples
cURL
curl -X POST https://api.wemail.io/v3/messages \
-H "Authorization: Bearer afn_live_pK7…b9aF" \
-H "Content-Type: application/json" \
-d '{
"from": "noreply@updates.acme.io",
"to": ["alex@example.com"],
"subject": "Welcome to Acme",
"html": "<h1>Hi Alex</h1><p>Glad to have you.</p>",
"tags": ["welcome", "v2"],
"headers": { "X-TES-MSGID": "tes-7f3a9c" }
}'Node.js
import { WemailClient } from "@wemail/sdk";
const wemail = new WemailClient(process.env.WEMAIL_API_KEY);
const { id } = await wemail.sendMessage({
from: "noreply@updates.acme.io",
to: ["alex@example.com"],
subject: "Welcome to Acme",
html: "<h1>Hi Alex</h1><p>Glad to have you.</p>",
tags: ["welcome", "v2"],
// stamped on the email, echoed on every webhook, returned by GET /v3/messages/{id}
headers: { "X-TES-MSGID": "tes-7f3a9c" },
});Python
from wemail.client import WemailClient
wemail = WemailClient(api_key=os.environ["WEMAIL_API_KEY"])
msg = wemail.send_message({
"from": "noreply@updates.acme.io",
"to": ["alex@example.com"],
"subject": "Welcome to Acme",
"html": "<h1>Hi Alex</h1><p>Glad to have you.</p>",
"tags": ["welcome", "v2"],
})PHP
<?php
$wemail = new \Wemail\WemailClient(getenv('WEMAIL_API_KEY'));
$msg = $wemail->sendMessage([
'from' => 'noreply@updates.acme.io',
'to' => ['alex@example.com'],
'subject' => 'Welcome to Acme',
'html' => '<h1>Hi Alex</h1>',
'tags' => ['welcome', 'v2'],
]);Ruby
wemail = Wemail::Client.new(api_key: ENV["WEMAIL_API_KEY"])
msg = wemail.send_message(
from: "noreply@updates.acme.io",
to: ["alex@example.com"],
subject: "Welcome to Acme",
html: "<h1>Hi Alex</h1>",
tags: ["welcome", "v2"]
)Go
client, err := wemail.NewClient(os.Getenv("WEMAIL_API_KEY"))
msg, err := client.SendMessage(wemail.SendMessageRequest{
From: "noreply@updates.acme.io",
To: []string{"alex@example.com"},
Subject: "Welcome to Acme",
Html: wemail.PtrString("<h1>Hi Alex</h1>"),
Tags: []string{"welcome", "v2"},
})Java
WemailClient wemail = new WemailClient(System.getenv("WEMAIL_API_KEY"));
SendMessage202Response msg = wemail.sendMessage(new SendMessageRequest()
.from("noreply@updates.acme.io")
.to(List.of("alex@example.com"))
.subject("Welcome to Acme")
.html("<h1>Hi Alex</h1>")
.tags(List.of("welcome", "v2")));.NET
var wemail = new WemailClient(Environment.GetEnvironmentVariable("WEMAIL_API_KEY"));
var msg = await wemail.SendMessageAsync(new SendMessageRequest {
From = "noreply@updates.acme.io",
To = new List<string> { "alex@example.com" },
Subject = "Welcome to Acme",
Html = "<h1>Hi Alex</h1>",
Tags = new List<string> { "welcome", "v2" },
});ResponseExample response
{
"id": "msg_01HBYE7K9Z4PMQDR3W",
"status": "queued",
"created_at": "2026-05-10T09:42:18Z",
"from": "noreply@updates.acme.io",
"to": ["alex@example.com"],
"tags": ["welcome", "v2"],
"headers": { "X-TES-MSGID": "tes-7f3a9c" }
}