Skip to main content
POST
Upsert Variant

Authorizations

Authorization
string
header
required

Pass as Authorization: ServiceToken <token>. 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). Must be a supported locale code.

Example:

"en"

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.

content
object

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

needs_vendor_approval
boolean

(SMS only) Whether this variant requires vendor (DLT) approval. Ignored for other channels: WhatsApp variants always require approval, and all other channels never do.

Response

Variant created successfully. Returns the full variant including its 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,
discarded,
upload_failed
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
enum<string> | null

Action taken in the latest commit (added, updated, unchanged, deleted, or null in draft).

Available options:
added,
updated,
unchanged,
deleted
created_at
string<date-time>

Timestamp when the variant was created.

content
object

Channel-specific content. Structure varies by channel. Returned by the variant detail endpoint, and by the variant list endpoints only when include_content=true is passed.

vendor_approvals
object[]

Vendor approval entries (WhatsApp/SMS only). Returned by the variant detail endpoint, and by the variant list endpoints only when include_content=true is passed.