Node.js SDK
import Migma from 'migma';
const migma = new Migma('YOUR_API_KEY');
const { data, error } = await migma.validation.deliverability({
html: '<html>...</html>',
subject: 'My Email Subject'
});curl --request POST \
--url https://api.migma.ai/v1/emails/validate/deliverability \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<string>",
"subject": "<string>",
"fromName": "<string>",
"fromEmail": "jsmith@example.com"
}
'import requests
url = "https://api.migma.ai/v1/emails/validate/deliverability"
payload = {
"html": "<string>",
"subject": "<string>",
"fromName": "<string>",
"fromEmail": "jsmith@example.com"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.migma.ai/v1/emails/validate/deliverability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'html' => '<string>',
'subject' => '<string>',
'fromName' => '<string>',
'fromEmail' => 'jsmith@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.migma.ai/v1/emails/validate/deliverability"
payload := strings.NewReader("{\n \"html\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.migma.ai/v1/emails/validate/deliverability")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"html\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.migma.ai/v1/emails/validate/deliverability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"prediction": {
"confidence": 123,
"score": 123,
"reasoning": "<string>"
},
"contentSignals": {
"promotional": [
"<string>"
],
"transactional": [
"<string>"
],
"spam": [
"<string>"
],
"engagement": [
"<string>"
]
},
"spamScore": {
"score": 123,
"triggers": [
"<string>"
],
"recommendations": [
"<string>"
]
},
"recommendations": {
"critical": [
"<string>"
],
"important": [
"<string>"
],
"suggested": [
"<string>"
]
},
"metadata": {
"processingTime": 123,
"analysisType": "<string>"
}
}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}Analyze Email Deliverability
Predict email deliverability and inbox placement (Inbox/Promotions/Spam) based on content analysis.
POST
/
v1
/
emails
/
validate
/
deliverability
Node.js SDK
import Migma from 'migma';
const migma = new Migma('YOUR_API_KEY');
const { data, error } = await migma.validation.deliverability({
html: '<html>...</html>',
subject: 'My Email Subject'
});curl --request POST \
--url https://api.migma.ai/v1/emails/validate/deliverability \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"html": "<string>",
"subject": "<string>",
"fromName": "<string>",
"fromEmail": "jsmith@example.com"
}
'import requests
url = "https://api.migma.ai/v1/emails/validate/deliverability"
payload = {
"html": "<string>",
"subject": "<string>",
"fromName": "<string>",
"fromEmail": "jsmith@example.com"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.migma.ai/v1/emails/validate/deliverability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'html' => '<string>',
'subject' => '<string>',
'fromName' => '<string>',
'fromEmail' => 'jsmith@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.migma.ai/v1/emails/validate/deliverability"
payload := strings.NewReader("{\n \"html\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.migma.ai/v1/emails/validate/deliverability")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"html\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.migma.ai/v1/emails/validate/deliverability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"html\": \"<string>\",\n \"subject\": \"<string>\",\n \"fromName\": \"<string>\",\n \"fromEmail\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"prediction": {
"confidence": 123,
"score": 123,
"reasoning": "<string>"
},
"contentSignals": {
"promotional": [
"<string>"
],
"transactional": [
"<string>"
],
"spam": [
"<string>"
],
"engagement": [
"<string>"
]
},
"spamScore": {
"score": 123,
"triggers": [
"<string>"
],
"recommendations": [
"<string>"
]
},
"recommendations": {
"critical": [
"<string>"
],
"important": [
"<string>"
],
"suggested": [
"<string>"
]
},
"metadata": {
"processingTime": 123,
"analysisType": "<string>"
}
}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}Authorizations
API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where YOUR_API_KEY is obtained from the Migma dashboard under Settings → Developers → API Keys.
Body
application/json
Was this page helpful?
⌘I