Email API for Developers

Mass Email Delivery,
Simplified for Everyone

Empower your applications with enterprise-grade email infrastructure. Built by developers, for developers—deliver messages that matter, at scale, without complexity.

Node.js logo icon for Metigan SDK integration
Node.js
TypeScript logo icon for Metigan SDK integration
TypeScript
Python logo icon for Metigan SDK integration
Python
PHP logo icon for Metigan SDK integration
PHP
Go logo icon for Metigan SDK integration
Go
Angular logo icon for Metigan SDK integration
Angular
NestJS logo icon for Metigan SDK integration
NestJS
nodejs.tsJavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const Metigan = require('metigan');

const metigan = new Metigan({
  apiKey: process.env.METIGAN_API_KEY
});

const result = await metigan.email.sendEmail({
  from: 'sender@example.com',
  recipients: ['recipient@example.com'],
  subject: 'Hello from Node.js!',
  content: '<p>This email was sent from a Node.js application.</p>'
});

console.log(result);

More Examples

Explore more examples for forms, contacts, audiences, and advanced features

Forms Example

forms-example.tsTypeScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import Metigan from 'metigan';

const metigan = new Metigan({ apiKey: 'your-api-key' });

const form = await metigan.forms.createForm({
  title: 'Contact Form',
  fields: [
    { id: 'field-email', type: 'email', label: 'Your Email', required: true },
    { id: 'field-message', type: 'textarea', label: 'Message', required: true }
  ]
});

const response = await metigan.forms.submit({
  formId: form.id!,
  data: {
    'field-email': 'user@email.com',
    'field-message': 'Hello!'
  }
});

Contacts & Audiences Example

contacts-example.tsTypeScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import Metigan from 'metigan';

const metigan = new Metigan({ apiKey: 'your-api-key' });

const audience = await metigan.audiences.create({
  name: 'Newsletter Subscribers'
});

const contact = await metigan.contacts.create({
  email: 'john@example.com',
  firstName: 'John',
  audienceId: audience.id!
});

const { contacts } = await metigan.contacts.list({
  audienceId: audience.id!
});

Python Forms Example

forms-example.pyPython
1
2
3
4
5
6
7
8
9
10
11
from metigan import MetiganClient

client = MetiganClient(api_key="your-api-key")

result = client.forms.submit(
    form_id="form-123",
    data={
        "field-email": "user@email.com",
        "field-message": "Hello!"
    }
)

PHP Contacts Example

contacts-example.phpPhp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

use Metigan\MetiganClient;

$client = new MetiganClient(getenv('METIGAN_API_KEY'));

// Create contact
$contact = $client->contacts()->create([
    'email' => 'john@example.com',
    'firstName' => 'John',
    'lastName' => 'Doe',
    'audienceId' => 'audience-123',
    'tags' => ['customer']
]);

// List contacts
$result = $client->contacts()->list([
    'audienceId' => 'audience-123',
    'status' => 'subscribed',
    'page' => 1,
    'limit' => 50
]);

echo "Total contacts: " . $result['pagination']['total'];

Ready to get started?

Send your first email in minutes. No credit card required.