Client libraries for every language
Official Mailpipe SDKs make it easy to integrate email into your application without dealing with raw HTTP. Every SDK is generated from the same OpenAPI spec so they stay in sync with the API.
Full TypeScript support with auto-generated types from the OpenAPI spec.
npm install @mailpipe/sdk
import { MailpipeClient } from '@mailpipe/sdk';
const client = new MailpipeClient({
apiKey: process.env.MAILPIPE_API_KEY,
});
// List unread messages
const messages = await client.messages.list({ unread: true });
console.log(messages.data);Sync and async clients. Compatible with Python 3.9+ and all major frameworks.
pip install mailpipe
from mailpipe import MailpipeClient
client = MailpipeClient(api_key=os.environ["MAILPIPE_API_KEY"])
# List unread messages
messages = client.messages.list(unread=True)
for msg in messages.data:
print(msg.subject)Idiomatic Go SDK with context support, zero external dependencies, and complete test coverage.
go get github.com/mailpipe/mailpipe-go
import "github.com/mailpipe/mailpipe-go"
client := mailpipe.NewClient(os.Getenv("MAILPIPE_API_KEY"))
// List unread messages
messages, err := client.Messages.List(ctx, &mailpipe.ListMessagesParams{
Unread: mailpipe.Bool(true),
})
if err != nil {
log.Fatal(err)
}Elegant Ruby SDK with Rails integration helpers and support for Ruby 3.0+.
gem install mailpipe
require 'mailpipe'
client = Mailpipe::Client.new(api_key: ENV['MAILPIPE_API_KEY'])
# List unread messages
messages = client.messages.list(unread: true)
messages.data.each { |msg| puts msg.subject }All SDKs accept your API key at construction time. Store the key in an environment variable — never hard-code it or commit it to source control.
MAILPIPE_API_KEY=mp_live_your-api-key-here
List endpoints return a paginated response with data, meta.total, meta.limit, meta.offset, and meta.has_more. SDKs expose auto-pagination helpers so you can iterate all results without managing offsets.
// Fetch every message automatically across all pages
for await (const message of client.messages.listAutoPaging()) {
console.log(message.subject);
}Every SDK raises a typed error class (e.g. MailpipeError) that includes the HTTP status code and machine-readable error code.
import { MailpipeClient, MailpipeError } from '@mailpipe/sdk';
try {
const message = await client.messages.get('msg_does_not_exist');
} catch (err) {
if (err instanceof MailpipeError) {
console.error(err.status); // 404
console.error(err.code); // "message_not_found"
console.error(err.message); // "No message found with id msg_does_not_exist"
}
}Every SDK ships a utility to verify webhook signatures so you do not have to implement HMAC verification yourself.
import { verifyWebhookSignature } from '@mailpipe/sdk';
app.post('/webhooks/mailpipe', (req, res) => {
const event = verifyWebhookSignature(
req.rawBody,
req.headers['x-mailpipe-signature'],
process.env.MAILPIPE_WEBHOOK_SECRET,
);
// event is fully typed — TypeScript knows the shape of event.data
// based on event.type
console.log(event.type); // "email.received"
res.sendStatus(200);
});Full TypeScript support with auto-generated types from the OpenAPI spec.
Sync and async clients. Compatible with Python 3.9+ and all major frameworks.
Idiomatic Go SDK with context support, zero external dependencies, and complete test coverage.
Elegant Ruby SDK with Rails integration helpers and support for Ruby 3.0+.
All SDKs are generated from the Mailpipe OpenAPI 3.1 specification. If your language is not listed above you can generate a client from the spec using any OpenAPI code generator.
curl -o mailpipe-openapi.json \ "https://api.mailpipe.dev/openapi.json"
Or browse the interactive spec at api.mailpipe.dev/docs.