mailfra
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

# No SDK required! Use the REST API directly
# Get your API key from Settings > API Keys

# Your API key format: sk_live_xxxxxxxxxxxxxxxx

2. Initialize the client

// Set your API key as an environment variable
// MAILFRA_API_KEY=sk_live_xxxxxxxxxxxxxxxx

const API_KEY = process.env.MAILFRA_API_KEY
const BASE_URL = "https://mailfra.com/api/v1"

// Helper function for API calls
async function mailfraAPI(endpoint, options = {}) {
  const response = await fetch(`${BASE_URL}${endpoint}`, {
    ...options,
    headers: {
      "Authorization": `Bearer ${API_KEY}`,
      "Content-Type": "application/json",
      ...options.headers,
    },
  })
  return response.json()
}

3. Create your first campaign

// Create a campaign
const campaign = await mailfraAPI("/campaigns", {
  method: "POST",
  body: JSON.stringify({
    name: "Q1 2024 Outreach",
    description: "Follow up with new leads",
  })
})

// Add prospects to campaign
await mailfraAPI("/prospects/bulk", {
  method: "POST",
  body: JSON.stringify({
    campaignId: campaign.id,
    prospects: [
      { email: "john@company.com", firstName: "John", company: "Acme Inc" },
      { email: "jane@tech.com", firstName: "Jane", company: "TechCorp" }
    ]
  })
})

// Launch campaign
await mailfraAPI(`/campaigns/${campaign.id}/launch`, { method: "POST" })

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://mailfra.com/api/v1/campaigns \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json"

API Key Format

API keys start with sk_live_ followed by a unique identifier. Keys are hashed with SHA-256 for security.

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"
                        }
                      }

REST API Integration

Use any HTTP client in any language - no SDK required

JS

JavaScript

fetch() / axios
Node.js & Browser
PY

Python

requests / httpx
Any Python version
SH

cURL

Command line
Shell scripts
🌐

Any Language

HTTP POST/GET
Universal REST

Ready to get started?

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