API Usage Examples
The unspam.email API enables you to automate and interact with your email deliverability testing workflows programmatically. All requests must be authenticated using your API token, which is included in the Authorization
header of your HTTP requests.
Authentication
Before accessing any secured endpoints, you must authenticate and retrieve your API token.
curl --location --request POST "https://api.unspam.email/api/login" \ --header "Content-Type: application/json" \ --data '{ "email": "user@example.com", "password": "your_password" }'
Use this token in the Authorization
header for all subsequent requests:
-H "Authorization: Bearer YOUR_API_TOKEN"
Email Tests
Generate a Unique Test Email
This endpoint provides a unique test email address to send your message to.
curl --location "https://api.unspam.email/api/get-email" \ --header "Authorization: Bearer YOUR_API_TOKEN"
Retrieve All Email Tests
List previously tested emails with optional ordering.
curl --location "https://api.unspam.email/api/emails?orders=created_at&direction=desc" \ --header "Authorization: Bearer YOUR_API_TOKEN"
Retrieve Email Test Results
Get full results of a specific email test using its resultIdPApf2zBmw9
.
curl --location "https://api.unspam.email/api/emails/PApf2zBmw9/results" \ --header "Authorization: Bearer YOUR_API_TOKEN"
Inbox Placement Tests
Start a New Inbox Placement Test
Create an inbox placement test across multiple mailbox providers.
curl --location --request POST "https://api.unspam.email/api/inbox-placement" \ --header "Authorization: Bearer YOUR_API_TOKEN"
List Inbox Placement Tests
curl --location "https://api.unspam.email/api/inbox-placement" \ --header "Authorization: Bearer YOUR_API_TOKEN"
Retrieve Inbox Placement Results
Use the resultId
from a placement test to get detailed results.
curl --location "https://api.unspam.email/api/inboxes/166:2024-06-11-14:28:58:000000302/results" \ --header "Authorization: Bearer YOUR_API_TOKEN"
Get Seed List for Placement Testing
Returns the list of test/seed email addresses used in inbox placement.
curl --location "https://api.unspam.email/api/inbox-placement/seed-list" \ --header "Authorization: Bearer YOUR_API_TOKEN"
Email Previews and Visuals
Get Email Screenshots
Retrieve how your email looks on desktop, tablet, and mobile using the resultIdPApf2zBmw9
curl --location "https://api.unspam.email/api/emails/PApf2zBmw9/screenshots" \ --header "Authorization: Bearer YOUR_API_TOKEN"
Get Heatmaps
Retrieve eye-tracking heatmaps that simulate user focus and attention using the resultIdPApf2zBmw9
.
curl --location "https://api.unspam.email/api/emails/PApf2zBmw9/heatmap" \ --header "Authorization: Bearer YOUR_API_TOKEN"