Documentation

Build with MailFra

Everything you need to integrate cold email infrastructure into your product. Comprehensive API reference, SDKs, and guides.

Quick Start

1. Install the SDK

npm install @mailfra/sdk
# or
yarn add @mailfra/sdk

2. Initialize the client

import { Mailfra } from '@mailfra/sdk'

const client = new Mailfra(process.env.MAILFRA_API_KEY)

3. Create your first campaign

// Create a campaign
const campaign = await client.campaigns.create({
  name: "Q1 2024 Outreach",
  subject: "Quick question about {{company}}",
  body: "Hi {{firstName}},\n\nI noticed your company...",
  sequenceId: "seq_abc123"
})

// Add prospects
await client.prospects.bulkCreate({
  campaignId: campaign.id,
  prospects: [
    { email: "john@company.com", firstName: "John", company: "Acme Inc" },
    { email: "jane@tech.com", firstName: "Jane", company: "TechCorp" }
  ]
})

// Launch campaign
await client.campaigns.launch(campaign.id)

Core Features

API Reference

Complete reference for all MailFra API endpoints

Campaigns

GET
/api/campaigns

List all campaigns

POST
/api/campaigns

Create a campaign

POST
/api/campaigns/:id/launch

Launch campaign

POST
/api/campaigns/:id/pause

Pause campaign

GET
/api/campaigns/:id/stats

Get statistics

Prospects

POST
/api/prospects/upload

Bulk upload prospects

POST
/api/research/prospect

Research a prospect

POST
/api/research/batch

Batch research

Sequences

POST
/api/sequences/create

Create sequence

POST
/api/campaigns/:id/sequence-triggers

Add triggers

POST
/api/campaigns/:id/automation-rules

Add automation

AI Tools

POST
/api/generate/email

Generate email content

POST
/api/predict/email-performance

Predict performance

POST
/api/ai/sequence-recommendations

Get sequence recommendations

Email Accounts

GET
/api/settings/sending-accounts

List email accounts

POST
/api/oauth/gmail

Connect Gmail

POST
/api/oauth/outlook

Connect Outlook

Domains

GET
/api/domains

List domains

POST
/api/domains

Add domain

GET
/api/domains/:id

Check domain health

Warmup

GET
/api/warmup/stats

Get warmup statistics

GET
/api/warmup/emails

List warmup emails

POST
/api/warmup/emails

Send warmup email

Analytics

GET
/api/campaigns/:id/emails

Get campaign emails

GET
/api/crm/stats

Get CRM statistics

Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header.

Example Request

curl https://api.mailfra.com/v1/campaigns \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

API Key Format

API keys start with mf_live_ for production or mf_test_ for testing.

Security Best Practices

  • Never expose API keys in client-side code
  • Rotate keys regularly
  • Use environment variables

Rate Limits

Rate limits are applied per API key to ensure fair usage and system stability.

Free Tier

100

requests/hour

Pro Tier

1,000

requests/hour

Enterprise

Custom

Contact sales

Rate Limit Headers

Every API response includes headers to help you track your rate limit status:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1640995200

Webhooks

Receive real-time notifications when events happen in your account.

email.sent

Email successfully sent to prospect

email.opened

Prospect opened your email

email.clicked

Prospect clicked a link

email.replied

Prospect replied to your email

email.bounced

Email bounced or failed

campaign.completed

Campaign finished sending

Webhook Payload Example

{
                        "event": "email.opened",
                        "timestamp": "2024-01-15T10:30:00Z",
                        "data": {
                          "emailId": "eml_abc123",
                          "campaignId": "cmp_xyz789",
                          "prospectId": "prs_def456",
                          "prospectEmail": "john@company.com",
                          "openedAt": "2024-01-15T10:30:00Z",
                          "userAgent": "Mozilla/5.0...",
                          "ipAddress": "203.0.113.0"
                        }
                      }

Official SDKs

Get started quickly with our official client libraries

JS

JavaScript/TypeScript

@mailfra/sdk
v2.1.0
PY

Python

mailfra
v1.8.0
RB

Ruby

mailfra-ruby
v1.4.0
GO

Go

github.com/mailfra/go-sdk
v1.2.0

Ready to get started?

Sign up for free and get your API key in seconds. No credit card required.

Limited Time Offer

Get 3 Months Free

Start your cold email journey with Mailfra today and get your first 3 months completely free. No credit card required.

Unlimited emails
AI warmup included
24/7 support
Free migration

Offer expires in 48 hours. Only 127 spots remaining.