Skip to content

Personalize API Early Access

TIP

Access to our APIs is evaluated on a case-by-case basis. To find out if your use case is one that we support feel free to get in touch with the details of your project. partners@litmus.com

Litmus Personalize provides the ability to create dynamic content that can be embedded into an email. We offer several variations of these, which are referred to as "content types", and each type is configured and used slightly different; the type-specific documentation below covers the relevant details.

Using the Personalize API, you'll primarily be performing 2 functions on any content type: previewing and publishing. Previewing is intended to be used during the authoring process while adjusting parameters, and returns images to help visualize those adjustments. Publishing finalizes a piece of content and provides an artifact that can be permanently embedded into a user's email.

Countdown timers

Preview

POST https://api.litmus.com/v3/personalize/timers/preview

Request

AttributeTypeDescription
template_slugstringtemplate identifier
expiration.timeISO 8601 timestamp (UTC)countdown target (should be future-dated)
expiration.messagestringdisplayed instead of the clock when the timer reaches zero
fontstringone of Montserrat, Open Sans, Roboto, Lato, Poppins, Noto Sans, Source Serif 4, Lora, PT Serif, Noto Serif, or Roboto Slab
colors.backgroundstringhex format color code for timer background
colors.textstringhex format color code for timer numbers and labels
mpp_messagestringoptional message to display to Apple MPP-affected recipients
json
{
    "data": {
        "attributes": {
            "template_slug": "default_timer",
            "expiration": {
                "time": "2024-02-09T00:00:00Z",
                "message": "The sale has ended."
            },
            "font": "Roboto",
            "colors": {
                "background": "#33A8CC",
                "text": "#FFFFFF"
            },
            "mpp_message": "Sale ends on November 20th!"
        }
    }
}

Response

AttributeTypeDescription
idintegertimer identifier
typestringJSON API type declaration
links.*.hrefstringURL for timer image variation (expiration, fallback, timer)
links.*.typestringimage format for the associated url
json
{
    "data": {
        "id": 1,
        "type": "timers",
        "links": {
            "expiration_image": {
                "href": "http://api.litmus.com/expiration_1",
                "type": "image/png"
            },
            "fallback_image": {
                "href": "http://api.litmus.com/fallback_1",
                "type": "image/png"
            },
            "timer_image": {
                "href": "http://api.litmus.com/timer_1",
                "type": "image/png"
            }
        }
    }
}

Publish

POST https://api.litmus.com/v3/personalize/timers

TIP

The request body for publishing is the same used for previewing.

Request

AttributesTypeDescription
template_slugstringtemplate identifier
expiration.timeISO 8601 timestamp (UTC)countdown target (should be future-dated)
expiration.messagestringdisplayed when the timer reaches zero
fontstringone of Montserrat, Open Sans, Roboto, Lato, Poppins, Noto Sans, Source Serif 4, Lora, PT Serif, Noto Serif, or Roboto Slab
colors.backgroundstringhex format color code for timer background
colors.textstringhex format color code for timer numbers and labels
mpp_messagestringoptional message to display to Apple MPP-affected recipients
json
{
    "data": {
        "attributes": {
            "template_slug": "default_timer",
            "expiration": {
                "time": "2024-02-09T00:00:00Z",
                "message": "The sale has ended."
            },
            "font": "Roboto",
            "colors": {
                "background": "#33A8CC",
                "text": "#FFFFFF"
            },
            "mpp_message": "Sale ends on November 20th!"
        }
    }
}

Response

AttributeTypeDescription
idintegertimer identifier
typestringJSON API type declaration
links.related.hrefstringURL for timer image
links.related.typestringimage format for the associated url, always image/gif
json
{
    "data": {
        "id": 1,
        "type": "timers",
        "links": {
            "related": {
                "href": "http://image.na.ca.litmus.com/t/timer_1.gif?exp=2024-02-09T02%3A00%3A00.0000000%2B00%3A00",
                "type": "image/gif"
            }
        }
    }
}

The links.related.href URL returned when publishing supports overriding the following parameters using merge tags:

ParameterTypeDescription
expISO 8601 timestamp (UTC)countdown target (should be future-dated)

Progress bars

Preview

POST https://api.litmus.com/v3/personalize/progress-bars/preview

Request

AttributeTypeDescription
template_slugstringtemplate identifier
minimum_valueintegerlower bound of progress range
maximum_valueintegerupper bound of progress range
colors.backgroundstringhex format color code for background
colors.progress_fillstringhex format color code for progress bar fill
colors.progress_backgroundstringhex format color code for area beneath the fill
colors.progress_valuestringhex format color code for progress number value
colors.minimum_valuestringhex format color code for minimum number value
colors.maximum_valuestringhex format color code for maximum number value
preview_data.progress_valueintegersets the progress amount used for this preview (should be between minimum/maximum_value)
json
{
    "data": {
        "attributes": {
            "template_slug": "linear_progress_bar",
            "minimum_value": 0,
            "maximum_value": 100,
            "colors": {
                "background": "#FFFFFF",
                "progress_fill": "#40DC59",
                "progress_background": "#EEEEEE",
                "progress_value": "#333333",
                "minimum_value": "#333333",
                "maximum_value": "#333333"
            },
            "preview_data": {
                "progress_value": 75
            }
        }
    }
}

Response

AttributeTypeDescription
idintegerprogress bar identifier
typestringJSON API type declaration
links.related.hrefstringURL for progress bar preview image
links.related.typestringimage format for the associated url
json
{
    "data": {
        "id": 1,
        "type": "progress_bars",
        "links": {
            "related": {
                "href": "http://api.litmus.com/progress_bar_1",
                "type": "image/png"
            }
        }
    }
}

Publish

POST https://api.litmus.com/v3/personalize/progress-bars

TIP

The request body for publishing is the same used for previewing, with the exception of preview_data.

Request

AttributesTypeDescription
template_slugstringtemplate identifier
minimum_valueintegerlower bound of progress range
maximum_valueintegerupper bound of progress range
colors.backgroundstringhex format color code for background
colors.progress_fillstringhex format color code for progress bar fill
colors.progress_backgroundstringhex format color code for area beneath the fill
colors.progress_valuestringhex format color code for progress number value
colors.minimum_valuestringhex format color code for minimum number value
colors.maximum_valuestringhex format color code for maximum number value
json
{
    "data": {
        "attributes": {
            "template_slug": "linear_progress_bar",
            "minimum_value": 0,
            "maximum_value": 100,
            "colors": {
                "background": "#FFFFFF",
                "progress_fill": "#40DC59",
                "progress_background": "#EEEEEE",
                "progress_value": "#333333",
                "minimum_value": "#333333",
                "maximum_value": "#333333"
            }
        }
    }
}

Response

AttributeTypeDescription
idintegertimer identifier
typestringJSON API type declaration
links.related.hrefstringURL for progress bar image
links.related.typestringimage format for the associated url
json
{
    "data": {
        "id": 1,
        "type": "progress_bars",
        "links": {
            "related": {
                "href": "http://image.na.ca.litmus.com/pb/progress_bar_1.png?min=0&max=100&cur=MERGE_YOUR_VALUE",
                "type": "image/png"
            }
        }
    }
}

The links.related.href URL returned when publishing supports overriding the following parameters using merge tags:

ParameterTypeDescription
minintegerlower bound of progress range
maxintegerupper bound of progress range
curintegersets the progress amount (should be between minimum/maximum_value)

Sentiment trackers

Preview

POST https://api.litmus.com/v3/personalize/sentiment-trackers/preview

Request

AttributeTypeDescription
template_slugstringtemplate identifier
colors.results_valuestringhex format color code for result values
json
{
    "data": {
        "attributes": {
            "template_slug": "emoji_sentiment_tracker",
            "colors": {
                "results_value": "#000000"
            }
        }
    }
}

Response

AttributeTypeDescription
idintegersentiment tracker identifier
typestringJSON API type declaration
links.<option_n>.hrefstringURL for sentiment tracker option
links.<option_n>.typestringimage format for sentiment tracker option
json
{
    "data": {
        "id": 1,
        "type": "sentiment_trackers",
        "links": {
            "option_1": {
                "href": "http://api.litmus.com/sentiment_tracker_1_option_1",
                "type": "image/png"
            },
            "option_2": {
                "href": "http://api.litmus.com/sentiment_tracker_1_option_2",
                "type": "image/png"
            },
            "option_3": {
                "href": "http://api.litmus.com/sentiment_tracker_1_option_3",
                "type": "image/png"
            }
        }
    }
}

Publish

POST https://api.litmus.com/v3/personalize/sentiment-trackers

Request

AttributeTypeDescription
template_slugstringtemplate identifier
urlintegerwhere we'll redirect users after voting
colors.results_valuestringhex format color code for result values
json
{
    "data": {
        "attributes": {
            "template_slug": "emoji_sentiment_tracker",
            "url": "https://litmus.com",
            "colors": {
                "results_value": "#000000"
            }
        }
    }
}

Response

AttributeTypeDescription
idintegersentiment tracker identifier
typestringJSON API type declaration
links.<option_n>.hrefstringURL for sentiment tracker option
links.<option_n>.typestringimage format for sentiment tracker option
links.<option_n>.meta.click_hrefstringclick-tracked URL for sentiment tracker option
json
{
    "data": {
        "id": 1,
        "type": "sentiment_trackers",
        "links": {
            "option_1": {
                "href": "http://api.litmus.com/sentiment_tracker_1_option_1",
                "type": "image/png",
                "meta": {
                    "click_href": "https://click.litmus.com/sentiment_tracker_1_option_1"
                }
            },
            "option_2": {
                "href": "http://api.litmus.com/sentiment_tracker_1_option_2",
                "type": "image/png",
                "meta": {
                    "click_href": "https://click.litmus.com/sentiment_tracker_1_option_2"
                }
            },
            "option_3": {
                "href": "http://api.litmus.com/sentiment_tracker_1_option_3",
                "type": "image/png",
                "meta": {
                    "click_href": "https://click.litmus.com/sentiment_tracker_1_option_3"
                }
            }
        }
    }
}

Report

GET https://api.litmus.com/v3/personalize/sentiment-trackers/:id/report

Request

AttributeTypeDescription
idintegersentiment tracker identifier

Response

AttributeTypeDescription
total_clicksintegertotal clicks
optionsarraylist of statistics for each option
    <option_n>.click_countintegernumber of clicks for this option
    <option_n>.click_percentintegerpercentage of clicks for this option
json
{
  "data": {
    "type": "sentiment_trackers_report",
    "id": 3,
    "attributes": {
      "total_clicks": 1234,
      "options": [
        {
          "option_1": {
            "click_count": 1000,
            "click_percent": 81
          }
        },
        {
          "option_2": {
            "click_count": 234,
            "click_percent": 19
          }
        }
      ]
    }
  }
}