mailjet API

Business / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

Mailjet lets you send transactional and marketing emails via a simple REST API using MJML or HTML templates. It includes real-time delivery tracking and contact list management.

💡

Beginner Tip

Authentication uses HTTP Basic Auth with your API key as username and secret key as password — not a Bearer token. Find both keys in the Mailjet dashboard under Account > API Keys.

Available Data

email delivery status
message ID
bounce/complaint data
open/click tracking
stock price and symbol
open/close/high/low values

Example Response

JSON Response
{
  "message_id": "msg_abc123def456",
  "status": "delivered",
  "to": "[email protected]",
  "subject": "Welcome!",
  "timestamp": "2025-01-15T10:30:00Z"
}

Field Reference

Messages Array of send result objects, one per message in the request.
Messages[].Status "success" if the message was accepted for delivery, "error" if it was rejected.
Messages[].To List of recipient objects, each containing their MessageID and MessageUUID.
Messages[].To[].MessageID Numeric ID assigned to the sent message — use this for delivery tracking lookups.
Messages[].To[].MessageUUID UUID string uniquely identifying this delivery attempt.
Messages[].Errors Present only on failure; contains error codes and descriptions for each rejection reason.

Implementation Example

const url = "https://www.mailjet.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Using Bearer token instead of Basic Auth for authentication
Use -u "API_KEY:SECRET_KEY" in curl. In code, base64-encode "API_KEY:SECRET_KEY" for the Authorization: Basic header.
400 MJ-0004 (invalid email) The recipient email address is malformed
Validate email format before sending. Mailjet rejects the entire request if any To address fails format validation.
Email delivered but lands in spam Sending domain lacks SPF and DKIM DNS records
In the Mailjet dashboard, verify your sending domain by adding the DNS records Mailjet provides — required for deliverability.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Business
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →