Skip to main content
PATCH
/
v2
/
{workspace}
/
template
/
{template_slug}
/
mock_data
Update Mock Data
curl -X PATCH "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/mock_data/" \
  --header 'Authorization: ServiceToken <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "payload": {"order_id": "ORD-1234", "amount": "$99.99"},
    "tenant_id": "default",
    "is_batch": false,
    "recipient_sub_type": "user",
    "recipient_distinct_id": "user-123"
  }'
{
  "data": {
    "payload": {
      "user": {
        "name": "Pat Morgan"
      },
      "event": {
        "status": "shipped"
      }
    },
    "tenant_id": "default",
    "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": "actor_67890"
  },
  "transformed_data": {
    "user": {
      "name": "Pat Morgan"
    },
    "event": {
      "status": "shipped"
    },
    "$batch_key": "evaluated batch_key",
    "$batched_events": [
      {
        "user": {
          "name": "Pat Morgan"
        },
        "event": {
          "status": "shipped"
        }
      },
      {
        "user": {
          "name": "Pat Morgan"
        },
        "event": {
          "status": "shipped"
        }
      }
    ],
    "$batched_events_count": 2,
    "$brand": {
      "brand_id": "default",
      "brand_name": "My Company",
      "logo": "https://cdn.example.com/logo.png",
      "primary_color": "#2E70E8",
      "secondary_color": "#63A3F7",
      "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"
      },
      "properties": {},
      "timezone": null
    },
    "$user": {
      "name": "Jamie Rivera",
      "email": "jamie.rivera@example.com",
      "distinct_id": "user_12345"
    },
    "$recipient": {
      "name": "Jamie Rivera",
      "email": "jamie.rivera@example.com",
      "distinct_id": "user_12345"
    },
    "$actor": {
      "name": "Taylor Chen",
      "email": "taylor.chen@example.com",
      "distinct_id": "actor_67890"
    },
    "$embedded_preference_url": "https://preferences.example.com/embed",
    "$hosted_preference_url": "https://preferences.example.com/?key=xxxxxxxxxxxxxxx"
  }
}

Authorizations

ServiceToken <token>
string
header
required

You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.

Path Parameters

workspace
string
required
template_slug
string
required

Body

application/json
payload
object

Input payload data with sample variable values.

tenant_id
string

Tenant ID for preview.

Example:

"default"

is_batch
boolean
default:false

Whether to simulate batched/digest data.

batch_count
integer

Number of batched events to simulate (only relevant when is_batch is true).

Example:

2

recipient_sub_type
enum<string>

Type of recipient.

Available options:
user,
object
Example:

"user"

recipient_distinct_id
string

Distinct ID of the test recipient (when recipient_sub_type is user).

Example:

"user-123"

recipient_object
object

Object identifier (when recipient_sub_type is object).

actor_sub_type
enum<string>

Type of actor.

Available options:
user,
object
actor_distinct_id
string

Distinct ID of the actor user.

actor_object
object

Object identifier for actor.

Response

Mock data updated successfully. Returns the same structure as Get Mock Data — both data (raw config) and transformed_data (resolved values).

The response is of type object.