Get your API key
SDKs

Client libraries

The MailKite API is plain JSON over HTTPS, so any stack works — reach for curl or your language's HTTP client and you're done. For the common languages we also ship thin official libraries with one shared shape: a low-level request() plus one function per endpoint. Want runnable code instead? Every stack has a working example in mailkite-examples — send, receive-as-webhook, and agent inboxes, generated from the same JSON Schemas the SDKs are conformance-tested against.

Supported languages

LanguagePackageInstallDocs & source
Node.js mailkite npm install mailkite npm GitHub
Python mailkite-dev pip install mailkite-dev PyPI GitHub
Go github.com/mailkite/mailkite-go go get github.com/mailkite/mailkite-go pkg.go.dev GitHub
PHP mailkite/mailkite composer require mailkite/mailkite Packagist GitHub
Java dev.mailkite:mailkite Maven Maven Central GitHub
Ruby mailkite gem install mailkite RubyGems GitHub
Any other Raw HTTP (curl tab below) API reference

Quick start

Create an API key in the dashboard (mk_live_…), set it as MAILKITE_API_KEY, then install and send. Pick your language once — every example on this page (and across the docs) follows your choice.

Install

install
npm install mailkite

Send a message

send a message
import { MailKite } from "mailkite";

const mk = new MailKite(process.env.MAILKITE_API_KEY);

const { id, status } = await mk.send({
from: "hello@myapp.ai",
to: "ada@example.com",
subject: "Your invoice #1042",
html: "<p>Thanks! Receipt attached.</p>",
});
Install Docs →

The curl tab is always there if there's no library for your language — every endpoint is a plain JSON request with a Bearer token. See the API reference for the rest.

One shape, every language

Each library exposes the same surface — a low-level request(method, path, body) and one thin method per endpoint. Only naming adapts to each language's convention (Go exports methods in PascalCase, e.g. mk.Send(…)).

send(message) POST /v1/send
agent({ text, routeId?, address?, model? }) POST /v1/agent
route({ routeId | address, from, … }) POST /v1/route
listDomains() GET /api/domains
createDomain({ domain }) POST /api/domains
getDomain(id) GET /api/domains/:id
deleteDomain(id) DELETE /api/domains/:id
verifyDomain(id) POST /api/domains/:id/verify
setWebhook(id, { url }) PUT /api/domains/:id/webhook
deleteWebhook(id) DELETE /api/domains/:id/webhook
testWebhook(id) POST /api/domains/:id/webhook/test
listRoutes() GET /api/routes
createRoute({ match, action, destination }) POST /api/routes
listMessages() GET /api/messages
getMessage(id) GET /api/messages/:id
retryDelivery(id) POST /api/deliveries/:id/retry
verifyWebhook(signature, payload, secret) local — HMAC check, no request
replyOk() local — webhook ack body, no request
replySpam() local — webhook ack body, no request
replyDrop() local — webhook ack body, no request
replyBlockSender() local — webhook ack body, no request
encrypt(plaintext, publicKey) local — at-rest envelope, no request
decrypt(envelope, privateKey) local — at-rest decrypt, no request

Tested against one contract

Every library is held to the same contract. A shared set of JSON-Schema-validated test cases lives alongside the SDKs, and a cross-language conformance harness drives each library through them — checking that the HTTP request it produces matches the schema and that responses and errors are parsed identically. So the Python send() and the Go Send() are guaranteed to put the same bytes on the wire.

AI agents: MCP server

@mailkite/mcp is a Model Context Protocol server that exposes MailKite to LLM agents — Claude Desktop, Claude Code, Cursor, and any MCP client. It's a thin layer over the same contract the SDKs use: one tool per endpoint (mailkite_send, mailkite_create_domain, …), with inputs validated against the shared JSON Schemas before any request is made. Source: github.com/mailkite/mailkite-mcp.

In Claude Code, one command adds it (use -s user for every project):

bash
claude mcp add mailkite -e MAILKITE_API_KEY=mk_live_… -- npx -y @mailkite/mcp

For Claude Desktop, Cursor, or any other client, add this to its MCP config and restart:

mcp.json
{
"mcpServers": {
"mailkite": {
"command": "npx",
"args": ["-y", "@mailkite/mcp"],
"env": { "MAILKITE_API_KEY": "mk_live_…" }
}
}
}

Full per-client steps and the tool list are on Agent inboxes & MCP. And for coding agents there's the agent skill — the whole email lifecycle as a drop-in playbook, installed with one command:

bash
npx skills add mailkite/agent-skills

Terminal: the CLI

Prefer the command line? @mailkite/cli is a wrangler-style client built on the same Node SDK — sign in, add domains, set DNS + webhooks, send mail, and tail inbound messages, all from your shell. Source: github.com/mailkite/mailkite-cli.

bash
npx @mailkite/cli send --from hello@mail.myapp.ai \
--to you@example.com --subject "It works" --html "<p>Hi</p>"

Next: the CLI reference, the full API reference, or the Send API for attachments and in-thread replies.