v2

latestOpenAPI 3.1.12026-07-2613060964.2 KB

Create or Update Variant

Create a new variant or update an existing one for a specific channel. Pass the variant content, conditions, locale, and optionally vendor approval details.

The content JSON structure is channel-specific. Refer to the variant content schema for each channel's structure.

post/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/

Path parameters

workspacestring required
template_slugstring required
channel'email' | 'sms' | 'whatsapp' | 'inbox' | 'androidpush' | 'iospush' | 'webpush' | 'slack' | 'ms_teams' required
variant_idstring required

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

Request body

localestring required

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

tenant_idstring nullable

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

contentobject required

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

needs_vendor_approvalboolean

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

seq_nointeger

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

vendor_approvalsobject[]

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

Example request

{
  "locale": "en"
}

Response

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

$schemastring

Schema URL for variant validation.

channelstring

Channel this variant belongs to.

idstring

Variant identifier.

tenant_idstring nullable

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

localestring

Locale code.

conditionsobject[]

Conditions for variant selection at send time.

hashstring

Content hash for change detection.

needs_vendor_approvalboolean

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

sysgen_template_namestring nullable

System-generated template name for vendor approval.

approval_status'auto_approved' | 'pending' | 'sent_for_approval' | 'approved' | 'rejected'

Current approval status of the variant.

discard_commentstring nullable

Reason provided when a variant is discarded.

approval_atstring date-time nullable

Timestamp when the variant was approved.

has_errorboolean

Whether the variant has validation errors.

seq_nointeger

Ordering within the channel + tenant + locale combination.

actionstring nullable

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

created_atstring date-time

Timestamp when the variant was created.

contentobject

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

vendor_approvalsobject[]

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

Example response

{
  "$schema": "https://schema.suprsend.com/template/v2/variant_schema.json",
  "channel": "email",
  "id": "default",
  "locale": "en"
}