Skip to content

Count the versions of an email's conditional content

POST
/api/v1/workspaces/{workspace}/campaigns/{campaignId}/visibility
curl --request POST \
--url https://reputecast.example.com/api/v1/workspaces/acme-newsletter/campaigns/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/visibility \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "html": "example", "mjml": "example", "recount": true }'

Permission: campaigns:view

Reads the Visibility rules of the content sent (the composer’s unsaved MJML and HTML) or saved, and counts the versions the campaign’s audience gets with the live audience. The count is kept until the rules or the audience change; recount counts again.

workspace
required

Workspace slug

string
/^[a-z0-9][a-z0-9-]{1,62}$/

Workspace slug

campaignId
required
string format: uuid
Media typeapplication/json
object
html
string
<= 2500000 characters
mjml
string
<= 2000000 characters
recount
boolean

Example generated

{
"html": "example",
"mjml": "example",
"recount": true
}

OK

Media typeapplication/json
object
blocks
required
Array<object>
object
broken
required
Array<object>
object
condition
required
integer format: int64
deletedAt
string format: date-time
deletedBy
string
kind
required
string
Allowed values: segment list field
name
required
string
id
required
string
name
required
string
path
required
Array<integer>
rule
required
object
conditions
required
Array<object>
object
field
string
kind
required
string
label
string
op
required
string
to
string
value
string
id
required
string
match
string
Allowed values: all any
show
required
string
Allowed values: everyone only except nobody
section
required
boolean
shown
required
integer format: int64
tag
required
string
versions
required
Array<integer>
words
required
string
checked
required
integer format: int64
counted
required
boolean
countedAt
string format: date-time
durationMs
required
integer format: int64
invalid
required
Array<string>
maxSize
required
integer format: int64
minSize
required
integer format: int64
missing
required
integer format: int64
possible
required
integer format: int64
total
required
integer format: int64
versions
required
Array<object>
object
checked
required
boolean
empty
required
boolean
hidden
required
Array<string>
largest
boolean
number
required
integer format: int64
overClip
required
boolean
recipients
required
integer format: int64
shown
required
Array<string>
shows
required
string
sizeBytes
required
integer format: int64
smallest
boolean

Example

{
"blocks": [
{
"broken": [
{
"kind": "segment"
}
],
"rule": {
"match": "all",
"show": "everyone"
}
}
]
}

Error

Media typeapplication/problem+json
object
code

Stable error code, e.g. permission_denied

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object>
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

helpers

Members who hold the missing permission

Array<string>
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
meta
object
key
additional properties
permission

The missing permission key

string
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}