Skip to content

Preview a post

Deprecated
POST
/api/v1/newsletters/preview
curl --request POST \
--url https://digize.com/api/v1/newsletters/preview \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "subject": "example", "preview": "example", "body": "", "format": "plain", "blocks": [], "access": "all", "visibility": "email_web", "web": { "title": "", "subtitle": "", "seoTitle": "", "seoDescription": "", "thumbnail": null, "tags": [], "authors": [] }, "slug": "example", "id": "example", "contactId": null, "medium": "email", "tier": "free" }'

Deprecated: use newsletter.posts.preview, which does the same. A post’s subject, HTML and text as a contact would get them, or with a sample reader’s (Alex Rivera, alex@example.com) without one, before it’s saved or sent; or its web page (medium: web). As a free reader by default, or a paid one, who reads past the paywall.

Needs the newsletter:read permission.

Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
subject
required
string
<= 200 characters
preview
required

The line inboxes show after the subject, hidden in an html post; a plain one shows its first line.

string
<= 200 characters
body

Text for plain, a whole HTML document for html; a blocks post keeps none. Variables such as {{first_name}} and {{contact.}} are filled in for each person.

string
"" <= 200000 characters
format
required

blocks for a post written in the editor (its blocks), plain for text, html for your own HTML.

string
Allowed values: plain html blocks
blocks

A blocks post’s content, each block with type and show (where it shows: on both, email or web; tiers all, free or paid). {{view_online}} is the link to read it in a browser, or on the site.

Array
default: <= 500 items
One of:
object
content
Array<object>
default: <= 2000 items
object
text
required
string
<= 20000 characters
marks
Array<string>
<= 5 items
Allowed values: bold italic underline strike code
href
string
>= 1 characters <= 2000 characters
type
required
string
Allowed value: paragraph
show
object
on
string
default: both
Allowed values: both email web
tiers
string
default: all
Allowed values: all free paid
access

Who it’s for: all, free readers only or paid readers only. A paid post with no paywall block shows free readers nothing.

string
default: all
Allowed values: all free paid
visibility

email_web goes by email and on the site once sent, email by email only, web only on the site (newsletter.posts.publish).

string
default: email_web
Allowed values: email_web email web
web
object
title

The headline on the site; the subject when empty.

string
"" <= 200 characters
subtitle
string
"" <= 300 characters
seoTitle

For search results and link previews; the title when empty.

string
"" <= 200 characters
seoDescription
string
"" <= 500 characters
thumbnail
Any of:
object
imageId
Any of:
string
<= 200 characters
url
required
string format: uri
<= 2000 characters
tags
Array<string>
default: <= 20 items
authors

Workspace members (members.list), with their names.

Array<object>
default: <= 10 items
object
id
required
string
>= 1 characters <= 64 characters
name
required
string
<= 120 characters
slug
Any of:
string
<= 80 characters
id

The saved post’s id, for its links.

string
>= 1 characters <= 64 characters
contactId
Any of:
string
>= 1 characters <= 64 characters
medium
string
default: email
Allowed values: email web
tier
string
default: free
Allowed values: free paid

Done

Media typeapplication/json
object
subject
required
string
html
required
string
text
required
string

Example generated

{
"subject": "example",
"html": "example",
"text": "example"
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}