Our SDKs used to do one thing: send email. The recently launched v2 adds the Team API. Manage domains, projects and webhooks right from your Node.js, PHP, Python, Go or Java code.
How it works
Sending email through our SDKs works the same as before. Check the UPGRADE.md of the SDK you use to see if anything changed in how you pass your project API token. Since our SDKs now also support the Team API, you can provide both a project API token and a team API token.
Depending on your setup, update the SDK to version 2. Then create a team API token in your team settings. This token gives you access to the same functionality as the Team API from within the SDK.
Here's an example with the Node.js SDK where we create a new project and send an email:
import { Lettermint } from 'lettermint';
const email = Lettermint.email('your-project-api-token');
const api = Lettermint.api('your-team-api-token');
// List domains
const domains = await lettermint.domains.list();
// Create a new project
const project = await lettermint.projects.create({ name: 'Production' });
// Send an email
const response = await lettermint.email
.from('sender@acme.com')
.to('recipient@acme.com')
.subject('Hello from Lettermint')
.text('This is a test email sent using the Lettermint Node.js SDK.')
.send();
Want to check the stats on your sent emails? Here's how:
import { Lettermint } from 'lettermint';
const api = Lettermint.api('your-team-api-token');
const stats = await api.stats.retrieve({
start: '2026-01-01',
end: '2026-01-31',
project_id: 'XXX',
});
For more examples, check out our documentation at lettermint.co/docs.