Official SDKs

Official client libraries for seven languages, ready to download and drop into your project.

wemail ships official client libraries for seven languages, each an idiomatic, thin wrapper over the v3 REST API. Download the one you need from this page — no build step required.

Available libraries
ParameterTypeRequiredDescription
Node.js / TypeScriptNode 20+OptionalPackage @wemailio/sdk. ESM and CJS. Stable (v3.0) · ZIP download.
PythonPython 3.10+OptionalSynchronous client on urllib3. Stable (v3.0) · ZIP download.
PHPPHP 8.1+OptionalGuzzle 7 / PSR-7 based. Stable (v3.0) · ZIP download.
RubyRuby 3.1+OptionalTyphoeus-based. Stable (v3.0) · ZIP download.
GoGo 1.22+OptionalContext-aware. Stable (v3.0) · ZIP download.
JavaJava 17+OptionalSynchronous client. Stable (v3.0) · ZIP download.
C# / .NET.NET 8+OptionalAsync-first. Stable (v3.0) · ZIP download.

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 "@wemailio/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
import os
from wemail 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"],
    "headers": {"X-TES-MSGID": "tes-7f3a9c"},
})
print(msg.id)
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><p>Glad to have you.</p>',
    'tags'    => ['welcome', 'v2'],
    'headers' => ['X-TES-MSGID' => 'tes-7f3a9c'],
]);
echo $msg->getId();
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><p>Glad to have you.</p>",
  tags: ["welcome", "v2"],
  headers: { "X-TES-MSGID" => "tes-7f3a9c" }
)
puts msg.id
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"},
    Headers: &map[string]string{"X-TES-MSGID": "tes-7f3a9c"},
})
Java
WemailClient wemail = new WemailClient(System.getenv("WEMAIL_API_KEY"));
MessageAccepted 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"))
    .headers(Map.of("X-TES-MSGID", "tes-7f3a9c")));
.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" },
  headers: new Dictionary<string, string> { ["X-TES-MSGID"] = "tes-7f3a9c" }));
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" }
}