Create a personalization slot
Define the content the web SDK renders into a slot (for example hero-banner or cart-empty) for one audience segment. A variant is keyed on slot + segment_label + variant, and only one active variant may exist per combination — creating a duplicate returns 409, so edit or deactivate the existing one first. Omit segment_label to define the default content every visitor sees when no segment-specific variant matches. content accepts formatting HTML; scripts, iframes, inline event handlers and javascript: or non-image data: URLs are rejected with 422 because the SDK injects the markup into your site. Owner or admin only.
Authorizations
Dashboard JWT token from Clerk
Headers
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
1 - 255Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.
true, false Body
Slot key the SDK asks for on the page — lowercase letters, digits, hyphen or underscore.
1 - 100^[a-z0-9-_]+$Markup or text rendered into the slot (up to 5,000 characters). Formatting HTML only — scripts, iframes and inline event handlers are rejected.
1 - 5000Audience segment this variant targets. Leave null for the default content shown to everyone else.
champion, high_value_engaged, engaged, new, passive, at_risk, dormant, lost, null Destination the call to action links to (http or https), if any.
500Label for the call-to-action button or link.
200Variant name for A/B testing (for example b). Report on it with the slot lift endpoint.
50Tie-breaker when several variants match the same visitor — highest wins. Defaults to 0.
0 <= x <= 100Whether the SDK may serve this variant. Defaults to true.
Free-form key/value data stored alongside the variant.