Preview what a send would do
On this page
POST
/v1/mailings/{mailing_id}/send-previewpreview_send| Risk | read |
| Authentication | API key or OAuth access token |
| Scopes | mailings:read |
| Idempotency | natural: repeating the call gives the same result |
| Dry run | not applicable |
| Success status | 200 |
| Response type | application/json |
What it does#
- Use when: A mailing draft is ready and you want the recipient count, the deliverability decision, tranche sizes, quota effect and a preview_token for request_send.
- Do not use when: you want to send (call request_send with the token this returns).
- Side effects: None.
- Reversible: Not applicable, nothing changes.
- Required scope: mailings:read.
- Idempotency: safe to repeat.
- Typical next step: call request_send with preview_token and an Idempotency-Key.
Scopes#
mailings:read: Read mailings and preview what a send would do.
Request#
Path parameters#
| Field | Type | Description |
|---|---|---|
mailing_id | string |
Query parameters#
None.
Response#
| Field | Type | Required | Description |
|---|---|---|---|
mailing_id | string | yes | |
mailing_revision | integer, min -9007199254740991, max 9007199254740991 | yes | |
mailing_status | string | yes | |
recipient_count | integer, min -9007199254740991, max 9007199254740991 | yes | Confirmed subscribers this mailing would reach right now. |
decision | one of "allow", "stage", "hold", "refused", "not_sendable" | yes | allow: sends as planned. stage: sends in tranches. hold: the owner reviews it first. refused: cannot be sent as it is. not_sendable: the mailing is not a draft. |
reasons | array of object | yes | Why the decision is not allow. Empty when it is allow. |
reasons[].code | string | yes | Stable reason code. Branch on this. |
reasons[].sentence | string | yes | The sentence the author sees in the dashboard for the same reason. |
tranche_sizes | array of integer, min -9007199254740991, max 9007199254740991 | yes | Recipients per tranche when the decision is stage. |
quota_effect | object | yes | |
quota_effect.recipients | integer, min -9007199254740991, max 9007199254740991 | yes | |
quota_effect.sent_today | integer, min -9007199254740991, max 9007199254740991 | yes | |
quota_effect.daily_cap | integer, min -9007199254740991, max 9007199254740991 or null | yes | |
quota_effect.exceeds_daily_cap | boolean | yes | |
links_checked | boolean | yes | False when link reputation is not yet known; the send still re-checks at send time. |
preview_token | string or null | yes | Pass to request_send within 15 minutes. Null when the mailing cannot be requested. |
expires_at | string or null | yes |
Examples#
ready to send#
Request:
curl -X POST 'https://api.seemly.com/v1/mailings/cmp_4d8x2p0q7r4d8x2p0q7r4d8x/send-preview' \
-H "Authorization: Bearer $SEEMLY_API_KEY"const response = await fetch("https://api.seemly.com/v1/mailings/cmp_4d8x2p0q7r4d8x2p0q7r4d8x/send-preview", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
},
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.post(
"https://api.seemly.com/v1/mailings/cmp_4d8x2p0q7r4d8x2p0q7r4d8x/send-preview",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
)
print(response.status_code, response.json())Response: 200:
{
"mailing_id": "cmp_4d8x2p0q7r4d8x2p0q7r4d8x",
"mailing_revision": 3,
"mailing_status": "draft",
"recipient_count": 212,
"decision": "allow",
"reasons": [],
"tranche_sizes": [],
"quota_effect": {
"recipients": 212,
"sent_today": 0,
"daily_cap": 500,
"exceeds_daily_cap": false
},
"links_checked": true,
"preview_token": "pvt_example.token",
"expires_at": "2026-12-02T09:45:00Z"
}Errors#
Every error is an application/problem+json body with a code, a fix sentence and next_actions. See reading a problem response.