> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wazobiamail.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Spam and deliverability scores

> Understand the spam-check score, threshold, rating and deliverability score, and decide whether an email is okay to send.

The pre-send spam check evaluates a draft against WazobiaMail's SpamAssassin-style rules and returns a penalty score, a threshold, a risk rating and a 0–100 deliverability score.

**Plan requirement:** `POST /sending/spam-check` is available on Business and Enterprise plans (and to platform administrators). Free, Starter and Pay-as-you-go accounts receive `403 Forbidden`.

```bash theme={null}
curl -X POST https://app.wazobiamail.com/api/v1/sending/spam-check \
  -H "X-API-Key: $WAZOBIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Your monthly account summary",
    "html": "<p>Hello Ade, here is your summary.</p>",
    "text": "Hello Ade, here is your summary.",
    "from": "Billing <billing@example.com>",
    "replyTo": "billing@example.com"
  }'
```

## The short answer

| `score` | `rating` | `badgeColor` | `isSpam` | `deliverabilityScore` | What it means |
| - | - | - | - | - | - |
| `0.0 – 1.9` | `low_risk` | green | `false` | `81 – 100` | **Okay to send.** The draft looks clean. |
| `2.0 – 4.9` | `moderate_risk` | yellow | `false` | `51 – 80` | **Review before sending.** It is not blocked, but the flagged rules increase risk. |
| `5.0 +` | `high_risk` | red | `true` | `0 – 50` | **Do not send.** The draft crosses the spam threshold; fix the rules first. |

Always trust the returned `isSpam` boolean when making an automated decision. It is calculated as `score >= threshold`, and the `threshold` field is the current server value (currently `5.0`).

## What each number means

* **`score`** — penalty points added by every triggered rule. **Lower is better.** A score of `0` is clean.
* **`threshold`** — the cut-off for `isSpam` (currently `5.0`). Do not hard-code it; read it from the response.
* **`isSpam`** — `true` when `score >= threshold`. This is the authoritative pass/fail signal.
* **`rating`** — `low_risk`, `moderate_risk` or `high_risk`.
* **`badgeColor`** — `green`, `yellow` or `red`, for dashboards.
* **`deliverabilityScore`** — the inverse health score from `0` to `100`. **Higher is better.** It is calculated as roughly `(10 - min(score, 10)) / 10 * 100`, so:
  * score `0.0` → `100`
  * score `1.2` → `88`
  * score `2.0` → `80`
  * score `5.0` → `50`
  * score `10.0+` → `0`
* **`rules`** — the individual findings. Each has `code`, `points`, `title`, `description` and a plain-English `recommendation`.
* **`summary`** — a human-readable sentence combining the risk label and score.

## What to fix first

1. Sort `rules` by `points` descending.
2. Fix the highest-point rules first; they move the score the most.
3. Re-run the check until `isSpam` is `false` and the score is in the green band (`< 2.0`).
4. For a yellow result (`2.0 – 4.9`), decide based on the rule types. Missing unsubscribe, deceptive links or missing plain text are worth fixing even though the result is not blocked.
5. Never treat a green score as a delivery guarantee. Domain authentication, sender reputation and recipient engagement still matter.

## Common high-point rules

| Rule family | Why it matters |
| - | - |
| Missing unsubscribe / List-Unsubscribe | Bulk and marketing mail needs a visible opt-out; compliance rules add significant points. |
| Deceptive or mismatched links | Visible link text that does not match the destination can look like phishing. |
| Empty or image-only body | Spam filters need readable text; a missing plain-text part adds points. |
| ALL CAPS / excessive punctuation / `$$$` | Aggressive subject lines look promotional and are penalised. |
| Risky HTML (`<script>`, `<iframe>`, `<form>`) | These elements are unsafe in email and are flagged. |
| Sender/Reply-To mismatch | A Reply-To on a different domain can look forged. |
| Spam trigger phrases | Urgency and “free money” phrasing raises the score. |

## SDK examples

```ts TypeScript theme={null}
const report = await client.messages.spamCheck({
  subject: 'Your account summary',
  htmlBody: '<p>Your summary is ready.</p>',
  textBody: 'Your summary is ready.',
});

console.log(report.data.score);              // 1.2
console.log(report.data.threshold);          // 5.0
console.log(report.data.isSpam);             // false
console.log(report.data.deliverabilityScore); // 88
console.log(report.data.rating);             // low_risk
```

```python Python theme={null}
report = client.messages.spam_check(
    subject="Your account summary",
    html="<p>Your summary is ready.</p>",
    text="Your summary is ready.",
)
print(report.data.score, report.data.is_spam, report.data.rating)
```

```php PHP theme={null}
$report = $client->messages()->checkSpam([
    'subject' => 'Your account summary',
    'html' => '<p>Your summary is ready.</p>',
    'text' => 'Your summary is ready.',
]);
if ($report['isSpam']) {
    // Block the send and show the recommendations.
}
```

```rust Rust theme={null}
let report = client.messages().spam_check(request).await?;
if report.data.is_spam {
    for rule in &report.data.rules {
        eprintln!("{}: {}", rule.code, rule.recommendation);
    }
}
```

## Related

* [Send transactional email](https://docs.wazobiamail.com/docs/guides/sending.md)
* [Official SDKs](https://docs.wazobiamail.com/docs/guides/sdks.md)
* [Tracking and delivery activity](https://docs.wazobiamail.com/docs/guides/tracking.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.