Mock Data
Get Mock Data
Retrieve the mock data (input payload, recipient, tenant, actor settings) for a template. Used for previewing and testing.
GET
/
v2
/
{workspace}
/
template
/
{template_slug}
/
mock_data
/
Get Mock Data
curl -X GET "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/?mode=draft" \
--header 'Authorization: ServiceToken <token>'
import requests
url = "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/"
headers = {"ServiceToken <token>": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'ServiceToken <token>': '<api-key>'}};
fetch('https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"ServiceToken <token>: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("ServiceToken <token>", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/")
.header("ServiceToken <token>", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["ServiceToken <token>"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"payload": {
"order_id": "ORD-8821",
"order_total": "$149.99",
"delivery_date": "2026-04-10",
"tracking_url": "https://yourapp.com/track/ORD-8821"
},
"tenant_id": "tenant_abc",
"is_batch": false,
"batch_count": 2,
"recipient_sub_type": "user",
"recipient_object": null,
"recipient_distinct_id": "user_12345",
"actor_sub_type": "user",
"actor_object": null,
"actor_distinct_id": null
},
"transformed_data": {
"order_id": "ORD-8821",
"order_total": "$149.99",
"delivery_date": "2026-04-10",
"tracking_url": "https://yourapp.com/track/ORD-8821",
"$batch_key": "evaluated batch_key",
"$batched_events": [
{
"order_id": "ORD-8821",
"order_total": "$149.99"
},
{
"order_id": "ORD-8821",
"order_total": "$149.99"
}
],
"$batched_events_count": 2,
"$brand": {
"brand_id": "tenant_abc",
"brand_name": "Acme Inc.",
"logo": "https://cdn.acme.com/logo.png",
"primary_color": "#1a73e8",
"secondary_color": "#34a853",
"tertiary_color": "#ffffff",
"embedded_preference_url": "https://preferences.example.com/embed",
"hosted_preference_domain": "preferences.example.com",
"blocked_channels": null,
"social_links": {
"website": "https://www.example.com",
"linkedin": "https://linkedin.com/company/example",
"twitter": ""
},
"properties": {},
"timezone": "America/New_York"
},
"$user": {
"name": "Jamie Rivera",
"email": "jamie.rivera@example.com"
},
"$recipient": {
"name": "Jamie Rivera",
"email": "jamie.rivera@example.com"
},
"$actor": {},
"$embedded_preference_url": "https://preferences.example.com/embed",
"$hosted_preference_url": "https://preferences.example.com/?key=xxxxxxxxxxxxxxx"
}
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "workspace 'demo' not found",
"detail": "workspace 'demo' not found"
}Authorizations
You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Query Parameters
Available options:
draft, live Response
Mock data retrieved. Returns both the raw data (what the user configured) and the transformed_data (resolved values including tenant, recipient, actor properties, and batched events).
Was this page helpful?
Previous
Update Mock DataUpdate the mock data for a template. Sets the input payload, recipient, tenant, actor, and batching configuration used for previews and testing.
Next
⌘I
Get Mock Data
curl -X GET "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/?mode=draft" \
--header 'Authorization: ServiceToken <token>'
import requests
url = "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/"
headers = {"ServiceToken <token>": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'ServiceToken <token>': '<api-key>'}};
fetch('https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"ServiceToken <token>: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("ServiceToken <token>", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/")
.header("ServiceToken <token>", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["ServiceToken <token>"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"payload": {
"order_id": "ORD-8821",
"order_total": "$149.99",
"delivery_date": "2026-04-10",
"tracking_url": "https://yourapp.com/track/ORD-8821"
},
"tenant_id": "tenant_abc",
"is_batch": false,
"batch_count": 2,
"recipient_sub_type": "user",
"recipient_object": null,
"recipient_distinct_id": "user_12345",
"actor_sub_type": "user",
"actor_object": null,
"actor_distinct_id": null
},
"transformed_data": {
"order_id": "ORD-8821",
"order_total": "$149.99",
"delivery_date": "2026-04-10",
"tracking_url": "https://yourapp.com/track/ORD-8821",
"$batch_key": "evaluated batch_key",
"$batched_events": [
{
"order_id": "ORD-8821",
"order_total": "$149.99"
},
{
"order_id": "ORD-8821",
"order_total": "$149.99"
}
],
"$batched_events_count": 2,
"$brand": {
"brand_id": "tenant_abc",
"brand_name": "Acme Inc.",
"logo": "https://cdn.acme.com/logo.png",
"primary_color": "#1a73e8",
"secondary_color": "#34a853",
"tertiary_color": "#ffffff",
"embedded_preference_url": "https://preferences.example.com/embed",
"hosted_preference_domain": "preferences.example.com",
"blocked_channels": null,
"social_links": {
"website": "https://www.example.com",
"linkedin": "https://linkedin.com/company/example",
"twitter": ""
},
"properties": {},
"timezone": "America/New_York"
},
"$user": {
"name": "Jamie Rivera",
"email": "jamie.rivera@example.com"
},
"$recipient": {
"name": "Jamie Rivera",
"email": "jamie.rivera@example.com"
},
"$actor": {},
"$embedded_preference_url": "https://preferences.example.com/embed",
"$hosted_preference_url": "https://preferences.example.com/?key=xxxxxxxxxxxxxxx"
}
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "workspace 'demo' not found",
"detail": "workspace 'demo' not found"
}