Skip to Content
Docs

Check an email before sending

POST
/v1/email/check

Reads an email for mistakes a send can't take back: links and images on a local address, placeholders nobody filled in, links that go nowhere, images without alt text, and HTML over the size Gmail clips at. Nothing is sent or stored, and no link is fetched, so a link that's simply broken won't be found. passed is false when any finding is an error. Anything else is worth a look, but the email would still work.

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key sent as Authorization: Bearer <key>. Looked up by SHA-256 hash (email_core::sha256_hex) against api_keys.hash; revoked keys and keys belonging to a suspended tenant are rejected. See the top-level Authentication section for permission levels.

Request Body

application/json
  1. body
subject?string
html_body?string
text_body?string

Response Body

The findings. An email with problems is still a 200.

application/json
  1. response
passed*boolean

False when any finding is an error.

errors*integer
warnings*integer
findings*array<>
Example Request
curl -X POST 'https://api.emitd.com/v1/email/check' \  -H 'Content-Type: application/json' \  -d '{  "subject": "Your receipt",  "html_body": "<a href=\"http://localhost:3000/orders/1\">View order</a>"}'
Example Response
{  "passed": false,  "errors": 1,  "warnings": 0,  "findings": [    {      "code": "local_link",      "severity": "error",      "message": "This link points at a local or private address, so it won't open for recipients.",      "detail": "http://localhost:3000/orders/1"    }  ]}