Skip to main content
POST
/
v2
/
{workspace}
/
template
/
{template_slug}
/
channel
/
{channel}
/
variant
/
{variant_id}
Upsert Variant
curl -X POST "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/" \
  --header 'Authorization: ServiceToken <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "locale": "en",
    "tenant_id": null,
    "conditions": [],
    "content": { ... }
  }'
{
  "$schema": "https://schema.suprsend.com/template/v2/variant_schema.json",
  "channel": "email",
  "id": "default",
  "tenant_id": null,
  "locale": "en",
  "conditions": [],
  "hash": "97f031b56ba642d137758652ce21dda6962ecee81d544fcf245661898107bcb9",
  "needs_vendor_approval": false,
  "sysgen_template_name": null,
  "approval_status": "auto_approved",
  "discard_comment": null,
  "approval_at": "2026-04-07T10:39:28.502737Z",
  "content": {
    "$schema": "https://schema.suprsend.com/template/v2/channel/email_schema.json",
    "templating_language": "handlebars",
    "from_name": "Acme Store",
    "from_address": "noreply@acme-store.com",
    "extra_to": "",
    "cc": "",
    "bcc": "",
    "reply_to": "",
    "subject": "Your order has been shipped - #{{order.number}}",
    "body": {
      "type": "raw",
      "raw": {
        "html": "<html><body><h1>Order Shipped!</h1><p>Hi {{customer.name}},</p><p>Your order <strong>#{{order.number}}</strong> has been shipped and is on its way.</p><p>Expected delivery: {{order.delivery_date}}</p><p><a href=\"{{{order.tracking_url}}}\">Track your order</a></p></body></html>",
        "text": "Hi {{customer.name}}, Your order #{{order.number}} has been shipped. Expected delivery: {{order.delivery_date}}. Track: {{{order.tracking_url}}}"
      },
      "designer": {
        "html": "...",
        "text": "...",
        "design_json": {},
        "merge_tags": [],
        "display_conditions": []
      },
      "preheader": "Your order #{{order.number}} is on its way",
      "plain_text": null,
      "email_markup": ""
    }
  },
  "errors": {},
  "vendor_approvals": [],
  "has_error": false,
  "seq_no": 1,
  "action": null,
  "created_at": "2026-04-07T10:39:28.510000Z"
}

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
channel
enum<string>
required
Available options:
email,
sms,
whatsapp,
inbox,
androidpush,
iospush,
webpush,
slack,
ms_teams
variant_id
string
required

Variant identifier. If a variant with this ID doesn't exist, a new one is created.

Body

application/json
locale
string
required

Locale code for the variant (e.g., en, es, fr).

Example:

"en"

content
object
required

Channel-specific content. See variant content schema for the structure of each channel.

tenant_id
string | null

Tenant ID this variant is scoped to. null for the default variant.

conditions
object[]

Conditions for variant selection. Structure follows the expression format.

needs_vendor_approval
boolean

(SMS only) Whether this variant requires vendor (DLT) approval.

seq_no
integer

Ordering of the variant within the same channel + tenant + locale combination.

vendor_approvals
object[]

Vendor approval entries for WhatsApp/SMS variants. See approval schema.

Response

Variant created or updated successfully. Returns the full variant including rendered content.

$schema
string

Schema URL for variant validation.

Example:

"https://schema.suprsend.com/template/v2/variant_schema.json"

channel
string

Channel this variant belongs to.

Example:

"email"

id
string

Variant identifier.

Example:

"default"

tenant_id
string | null

Tenant this variant is scoped to, or null for default.

locale
string

Locale code.

Example:

"en"

conditions
object[]

Conditions for variant selection at send time.

hash
string

Content hash for change detection.

needs_vendor_approval
boolean

Whether this variant requires vendor approval (SMS DLT, WhatsApp).

sysgen_template_name
string | null

System-generated template name for vendor approval.

approval_status
enum<string>

Current approval status of the variant.

Available options:
auto_approved,
pending,
sent_for_approval,
approved,
rejected
discard_comment
string | null

Reason provided when a variant is discarded.

approval_at
string<date-time> | null

Timestamp when the variant was approved.

has_error
boolean

Whether the variant has validation errors.

seq_no
integer

Ordering within the channel + tenant + locale combination.

action
string | null

Action taken in the latest commit (Updated, Added, Unchanged, or null).

created_at
string<date-time>

Timestamp when the variant was created.

content
object

Channel-specific content. Structure varies by channel. Only returned in variant detail endpoint.

vendor_approvals
object[]

Vendor approval entries (WhatsApp/SMS only). Only returned in variant detail endpoint.