Preview content without saving
On this page
POST
/v1/design/renderrender_design| Risk | read |
| Authentication | API key or OAuth access token |
| Scopes | design: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: You want the HTML, plain text, size and problems for content before you save a draft. Sections are heading, paragraph, image, button, book or divider objects (fields under simple.sections).
- Do not use when: you want to render a saved mailing (call render_mailing).
- Side effects: None.
- Reversible: Not applicable, nothing changes.
- Required scope: design:read.
- Idempotency: safe to repeat.
- Typical next step: fix each problem it lists, then call create_mailing_draft.
Scopes#
design:read: Read design starters and skins, and render a design to HTML.
Request#
Path parameters#
None.
Query parameters#
None.
Body (application/json)#
| Field | Type | Required | Description |
|---|---|---|---|
subject | string, max 200 characters | no | Checked for merge field problems when given |
from_name | string, max 100 characters | no | The sender name you plan to use. Give it to learn whether an empty name would fall back to a generic workspace default. |
simple | object | no | |
simple.starter_id | string, max 41 characters, default "blank" | no | |
simple.skin_id | string, max 40 characters, default "neutral" | no | |
simple.preheader | string, max 150 characters | no | |
simple.facts | object | no | |
simple.facts.author_name | string, max 70 characters | no | The name in the masthead and the signature. The workspace sender_name (get_workspace) is usually the right value. Without it the starter shows an example name and the mailing cannot be sent. |
simple.facts.logo_url | string, max 2048 characters | no | |
simple.facts.portrait_url | string, max 2048 characters | no | |
simple.facts.book | object | no | |
simple.sections | array of object, max 30 items, default [] | no | Body sections in order. Each is an object whose type is one of heading, paragraph, image, button, book, divider, with these fields: heading: text (required), level (default 2), eyebrow; paragraph: text (required); image: src (required), alt (default ""), decorative, href, caption; button: label (required), href (required), width (default "auto"); book: title (required), blurb, cover_url, series, series_number, release_date, button_label (default "Get the book"), href (required), badge; divider: style (default "rule"). Leave sections out to keep the starter's own body, which still has example text until you replace it. |
simple.sections[type=heading].text | string, max 160 characters | yes | |
simple.sections[type=heading].level | one of 1, 2, 3, default 2 | no | |
simple.sections[type=heading].eyebrow | string, max 60 characters | no | |
simple.sections[type=paragraph].text | string, max 8000 characters | yes | Plain text. A blank line starts a new paragraph. Allowed inline marks: bold, _italic_, label. Merge fields look like {{first_name|there}} and are never allowed inside a link address. |
simple.sections[type=image].src | string, max 2048 characters | yes | An https address, or an address returned by upload_mailing_image |
simple.sections[type=image].alt | string, max 200 characters, default "" | no | |
simple.sections[type=image].decorative | boolean | no | |
simple.sections[type=image].href | string, max 2048 characters | no | |
simple.sections[type=image].caption | string, max 200 characters | no | |
simple.sections[type=button].label | string, max 40 characters | yes | |
simple.sections[type=button].href | string, max 2048 characters | yes | |
simple.sections[type=button].width | one of "auto", "full", default "auto" | no | |
simple.sections[type=book].title | string, max 120 characters | yes | |
simple.sections[type=book].blurb | string, max 2000 characters | no | |
simple.sections[type=book].cover_url | string, max 2048 characters | no | |
simple.sections[type=book].series | string, max 120 characters | no | |
simple.sections[type=book].series_number | string, max 20 characters | no | |
simple.sections[type=book].release_date | string, max 40 characters | no | |
simple.sections[type=book].button_label | string, max 40 characters, default "Get the book" | no | |
simple.sections[type=book].href | string, max 2048 characters | yes | |
simple.sections[type=book].badge | string, max 30 characters | no | |
simple.sections[type=divider].style | one of "rule", "ornament", "dots", "space", default "rule" | no | |
design | object | no |
Response#
| Field | Type | Required | Description |
|---|---|---|---|
html | string | yes | |
text | string | yes | |
bytes | integer, min -9007199254740991, max 9007199254740991 | yes | |
max_bytes | integer, min -9007199254740991, max 9007199254740991 | yes | |
sendable | boolean | yes | False while any error-severity problem remains |
problems | array of object | yes | |
problems[].severity | one of "error", "warning" | yes | |
problems[].code | string | yes | |
problems[].message | string | yes | |
problems[].block_id | string | no | |
problems[].field | string | no | The request field to change, for example simple.facts.author_name, when the problem comes from something you sent |
problems[].fix | string | yes | One imperative sentence: what to change |
Examples#
simple form#
Request:
curl -X POST 'https://api.seemly.com/v1/design/render' \
-H "Authorization: Bearer $SEEMLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"simple": {
"starter_id": "blank",
"skin_id": "neutral",
"sections": [
{
"type": "paragraph",
"text": "Hello {{first_name|there}}, chapter two is up."
}
]
}
}'const response = await fetch("https://api.seemly.com/v1/design/render", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"simple": {
"starter_id": "blank",
"skin_id": "neutral",
"sections": [
{
"type": "paragraph",
"text": "Hello {{first_name|there}}, chapter two is up."
}
]
}
}),
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.post(
"https://api.seemly.com/v1/design/render",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
json={
"simple": {
"starter_id": "blank",
"skin_id": "neutral",
"sections": [
{
"type": "paragraph",
"text": "Hello {{first_name|there}}, chapter two is up.",
},
],
},
},
)
print(response.status_code, response.json())Response: 200:
{
"html": "<!doctype html><html><body><p>Hello</p></body></html>",
"text": "Hello",
"bytes": 52,
"max_bytes": 92160,
"sendable": true,
"problems": []
}Errors#
Every error is an application/problem+json body with a code, a fix sentence and next_actions. See reading a problem response.