API
API for developers
Three calls: create a test, send an email, read the result. JSON, key in a header, OpenAPI to generate a client.
Authentication
Header X-API-Key (or Authorization: Bearer). Create keys in the dashboard; without a key the free per-IP limits apply.
curl -X POST https://dev.spamtest.pl/api/v1/tests \
-H "X-API-Key: st_..." -H "Content-Type: application/json" \
-d '{"lang":"en","placement":false}'
{ "token":"k7m2xp9q4w", "address":"test-k7m2xp9q4w@dev.spamtest.pl",
"url":"https://dev.spamtest.pl/t/k7m2xp9q4w", "seed_addresses":[] }
Test flow
- POST /api/v1/tests โ token and address test-<token>@spamtest.pl (optionally seed_addresses for inbox placement).
- Send a message to that address (and the seed addresses) from your system.
- GET /api/v1/tests/{token} โ status waiting โ received โ done; score, verdict, findings with title and fix in the chosen language, full facts.
curl https://dev.spamtest.pl/api/v1/tests/k7m2xp9q4w -H "X-API-Key: st_..."
{ "status":"done", "score":91.0, "verdict":"inbox",
"result": { "findings":[{"key":"dmarc_p_none","severity":"minor","points":3,"title":"โฆ","fix":"โฆ"}],
"facts": { "envelope":{โฆ}, "rspamd":{"auth":{"spf":"pass","dkim":"pass","dmarc":"pass"}}, โฆ } } }
Endpoints
| Endpoint | Description | Key |
|---|---|---|
POST /api/v1/tests | New test; with a key no daily limit, placement: true consumes a credit | optional |
GET /api/v1/tests/{token} | Test status and report | โ |
GET /api/v1/domain/{domain} | Domain DNS audit (SPF, DKIM, DMARC, MX, MTA-STS, TLS-RPT, BIMI, DBL); 10-minute cache | optional |
GET /api/v1/blacklist/{ip} | IP check on 8 DNSBLs + FCrDNS | optional |
Limits
Free: 3 tests/day and 30 DNS checks per IP. Plans: per pricing; exceeding returns 429 with used/limit. Test results stay available for 90 days.
CI/CD integration
The simplest deliverability regression guard: after a deploy, send a transactional email to a test address and fail the pipeline when the score drops below a threshold.
# GitHub Actions / any CI โ fail the build when the deliverability score drops
TOKEN=$(curl -s -X POST https://dev.spamtest.pl/api/v1/tests -H "X-API-Key: $SPAMTEST_KEY" | jq -r .token)
python send_test_mail.py "test-$TOKEN@dev.spamtest.pl"
sleep 20
SCORE=$(curl -s https://dev.spamtest.pl/api/v1/tests/$TOKEN | jq -r .score)
[ "${SCORE%.*}" -ge 85 ] || { echo "deliverability score $SCORE < 85"; exit 1; }