Mail API reference

Mail API · Templates

post/v1/workspaces/{workspace_id}/templates/lintAuth

Lint a draft for deliverability red flags. Same render pipeline as /preview; returns a 0-100 score (higher is better) and a sorted list of findings (errors first). Self-developed heuristic linter, no external classifier — runs in-process.

Path parameters

workspace_id*string · uuid

Id of the workspace.

Request body

subjectstring

Subject template (Handlebars).

body_html*string

HTML body to render (Handlebars).

dataobject

Sample data to render variables with. Keys are your variable names and are kept exactly as sent.

Response · 200

score*number

0-100, higher is better. ≥90 "looks great"; <70 "likely to spam-folder".

findings*array

Every problem found, most severe first.

Example

Request

POST https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/templates/lint
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "subject": "string",
  "body_html": "string",
  "data": {}
}

Response

{
  "score": 0,
  "findings": [
    {
      "id": "string",
      "severity": {},
      "message": "string",
      "suggestion": "string"
    }
  ]
}