Skip to content

Preview content without saving

On this page
POST/v1/design/renderrender_design
Riskread
AuthenticationAPI key or OAuth access token
Scopesdesign:read
Idempotencynatural: repeating the call gives the same result
Dry runnot applicable
Success status200
Response typeapplication/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)#

FieldTypeRequiredDescription
subjectstring, max 200 charactersnoChecked for merge field problems when given
from_namestring, max 100 charactersnoThe sender name you plan to use. Give it to learn whether an empty name would fall back to a generic workspace default.
simpleobjectno
simple.starter_idstring, max 41 characters, default "blank"no
simple.skin_idstring, max 40 characters, default "neutral"no
simple.preheaderstring, max 150 charactersno
simple.factsobjectno
simple.facts.author_namestring, max 70 charactersnoThe 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_urlstring, max 2048 charactersno
simple.facts.portrait_urlstring, max 2048 charactersno
simple.facts.bookobjectno
simple.sectionsarray of object, max 30 items, default []noBody 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].textstring, max 160 charactersyes
simple.sections[type=heading].levelone of 1, 2, 3, default 2no
simple.sections[type=heading].eyebrowstring, max 60 charactersno
simple.sections[type=paragraph].textstring, max 8000 charactersyesPlain 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].srcstring, max 2048 charactersyesAn https address, or an address returned by upload_mailing_image
simple.sections[type=image].altstring, max 200 characters, default ""no
simple.sections[type=image].decorativebooleanno
simple.sections[type=image].hrefstring, max 2048 charactersno
simple.sections[type=image].captionstring, max 200 charactersno
simple.sections[type=button].labelstring, max 40 charactersyes
simple.sections[type=button].hrefstring, max 2048 charactersyes
simple.sections[type=button].widthone of "auto", "full", default "auto"no
simple.sections[type=book].titlestring, max 120 charactersyes
simple.sections[type=book].blurbstring, max 2000 charactersno
simple.sections[type=book].cover_urlstring, max 2048 charactersno
simple.sections[type=book].seriesstring, max 120 charactersno
simple.sections[type=book].series_numberstring, max 20 charactersno
simple.sections[type=book].release_datestring, max 40 charactersno
simple.sections[type=book].button_labelstring, max 40 characters, default "Get the book"no
simple.sections[type=book].hrefstring, max 2048 charactersyes
simple.sections[type=book].badgestring, max 30 charactersno
simple.sections[type=divider].styleone of "rule", "ornament", "dots", "space", default "rule"no
designobjectno

Response#

FieldTypeRequiredDescription
htmlstringyes
textstringyes
bytesinteger, min -9007199254740991, max 9007199254740991yes
max_bytesinteger, min -9007199254740991, max 9007199254740991yes
sendablebooleanyesFalse while any error-severity problem remains
problemsarray of objectyes
problems[].severityone of "error", "warning"yes
problems[].codestringyes
problems[].messagestringyes
problems[].block_idstringno
problems[].fieldstringnoThe request field to change, for example simple.facts.author_name, when the problem comes from something you sent
problems[].fixstringyesOne 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."
      }
    ]
  }
}'

Response: 200:

JSON
{
  "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.

Typical next steps#

View this page as MarkdownReport a problem with this page

Type to search. Try a method and path, an operation name or an error code.