InboxIssue

Spam Tests API

Create and retrieve spam test results via API

The Spam Tests API is the core InboxIssue API for email deliverability testing. Use this API to create tests, send your emails, and view results.

Viewing Results: Spam test results are typically viewed on the shareable reports page in the InboxIssue dashboard. Each test has a unique URL you can share with your team or clients.

Create Spam Test

Create a new spam test with all available providers.

POST /api/v1/spam_tests

Request Body

{
  "spam_test": {
    "name": "Newsletter Campaign Test",
    "sender_email_address": "newsletter@yourcompany.com",
    "provider_types": ["consumer", "business"],
    "metadata": {
      "campaign_id": "camp_123"
    }
  }
}

Parameters

ParameterTypeRequiredDescription
namestringNoHuman-readable test name
sender_email_addressstringNoFrom address for tracking
provider_typesarrayNoProvider types to include
metadataobjectNoCustom key-value pairs

Response

Returns 201 Created on success with test details and send instructions.

{
  "success": true,
  "spam_test": {
    "id": 12345,
    "public_id": "ABC123",
    "name": "Newsletter Campaign Test",
    "status": "pending",
    "tracking_key": "inboxissue-12345-2024-01-15-inboxissue",
    "created_at": "2024-01-15T10:30:00Z",
    "send_to": [
      "test1@gmail.com",
      "test2@yahoo.com",
      "test3@outlook.com"
    ]
  },
  "instructions": {
    "message": "Send your test email to the addresses listed in send_to",
    "include_tracking_key": true,
    "timeout_minutes": 60
  }
}

Get Spam Test

Retrieve a spam test by ID or public ID.

GET /api/v1/spam_tests/:id

Path Parameters

ParameterTypeDescription
idstringTest ID or public ID (e.g., ABC123)

Response

{
  "success": true,
  "spam_test": {
    "id": 12345,
    "public_id": "ABC123",
    "name": "Newsletter Campaign Test",
    "status": "complete",
    "sender_email_address": "newsletter@yourcompany.com",
    "subject": "Your Weekly Newsletter",
    "created_at": "2024-01-15T10:30:00Z",
    "completed_at": "2024-01-15T10:45:00Z",
    "metadata": {
      "campaign_id": "camp_123"
    }
  },
  "summary": {
    "total": 10,
    "inbox": 8,
    "spam": 2,
    "missing": 0,
    "inbox_rate": 80.0
  },
  "results": [
    {
      "id": 98765,
      "email_provider": {
        "name": "gmail.com",
        "type": "consumer"
      },
      "delivery": {
        "status": "delivered",
        "folder": "INBOX",
        "is_inbox": true,
        "is_spam": false,
        "delivery_time_seconds": 165
      },
      "authentication": {
        "spf": { "pass": true, "result": "pass" },
        "dkim": { "pass": true, "result": "pass" },
        "dmarc": { "pass": true, "result": "pass" }
      },
      "received_at": "2024-01-15T10:32:45Z"
    }
  ]
}

List Spam Tests

List spam tests with pagination and filtering.

GET /api/v1/spam_tests

Query Parameters

ParameterTypeDefaultDescription
statusstring-Filter: pending, in_progress, complete
pageinteger1Page number
per_pageinteger25Results per page (max 100)

Response

{
  "success": true,
  "spam_tests": [
    {
      "id": 12345,
      "public_id": "ABC123",
      "name": "Newsletter Campaign Test",
      "status": "complete",
      "inbox_rate": 80.0,
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "per_page": 25,
    "total_pages": 4,
    "total_count": 87
  }
}

Reference

Test Status Values

StatusDescription
pendingTest created, no results received
in_progressSome results received
completeAll results received or test expired

Delivery Status Fields

FieldTypeDescription
statusstringdelivered, pending, missing
folderstringDelivery folder (e.g., INBOX, Junk)
is_inboxbooleanDelivered to inbox
is_spambooleanDelivered to spam/junk
delivery_time_secondsintegerTime from send to receipt

Authentication Results

Each result includes authentication analysis:

FieldDescription
spfSPF verification result
dkimDKIM signature verification
dmarcDMARC policy compliance
comp_authMicrosoft composite authentication

Microsoft Spam Scores

Microsoft mailboxes include spam confidence scores:

ScoreRangeDescription
microsoft_scl0-9Spam Confidence Level
microsoft_bcl0-9Bulk Complaint Level

Code Examples

import requests
 
API_TOKEN = "your_api_token"
BASE_URL = "https://app.inboxissue.com/api/v1"
 
headers = {
    "Authorization": f"Bearer {API_TOKEN}",
    "Content-Type": "application/json"
}
 
# Create a test
response = requests.post(
    f"{BASE_URL}/spam_tests",
    headers=headers,
    json={
        "spam_test": {
            "name": "My Campaign Test",
            "provider_types": ["consumer", "business"]
        }
    }
)
test = response.json()
 
print(f"Send emails to: {test['spam_test']['send_to']}")
print(f"Include tracking key: {test['spam_test']['tracking_key']}")
 
# Get results
test_id = test['spam_test']['public_id']
response = requests.get(
    f"{BASE_URL}/spam_tests/{test_id}",
    headers=headers
)
result = response.json()
print(f"Inbox rate: {result['summary']['inbox_rate']}%")

On this page