Preview a broadcast
The broadcast rendered through the renderer a send uses, for one contact of its contact book (contactId; a key limited to one domain answers 403…
https://app.usenotix.dev/api/v1/broadcasts/{broadcastId}/previewFull access and read only keys can call this. Sending access keys cannot. Key permissions lists the extra rules some calls have.
The broadcast rendered through the renderer a send uses, for one contact of its contact book (contactId; a key limited to one domain answers 403 DOMAIN_PINNED and previews with the sample contact only) or a sample contact with no name: subject, preview text, HTML and the plain text part. The unsubscribe link goes nowhere. Notix does not load the email's images, follow its links or count an open; the HTML is your content returned as data, so show it only in a sandboxed frame.
Who can call it
Any key that reads broadcasts: full access, read only and live AI keys. A send-only key answers 403 SCOPE_DENIED. A key limited to one domain sees only broadcasts that send from its domain; any other answers 404.
Path parameters
Query parameters
Render for this contact of the campaign's contact book. Leave out for a sample contact with no name.
Headers
Bearer followed by your API key.
Errors
`DOMAIN_PINNED`: a key limited to one domain asked for a `contactId`; it previews with the sample contact only.
No such campaign for the calling team, or `contactId` is not in the campaign's contact book.
The team previewed campaigns 60 times in the last minute.
The call could not be counted just now. Try again shortly.
Every error has the same shape. See all error codes.
curl -X GET "https://app.usenotix.dev/api/v1/broadcasts/<broadcastId>/preview" \
-H "Authorization: Bearer $NOTIX_API_KEY"
import { Notix } from "notix-js";
const notix = new Notix(process.env.NOTIX_API_KEY);
const { data, error } = await notix.broadcasts.preview("cmp_123", { contactId: "ct_123" });
// data.html is your content as data: show it only in a sandboxed iframe.
{
"campaignId": "cm1x8f3k20001qz7v5b9d2e4a",
"subject": "Your receipt for order 4471",
"previewText": "Thanks for your order.",
"html": "<p>Thanks for your order.</p>",
"text": "Thanks for your order.",
"sampleContact": true
}