curl --request POST \
--url https://api.orbit.devotel.io/api/v1/personalization/slots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slot": "hero-banner",
"segment_label": "at_risk",
"content": "<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>",
"cta_url": "https://shop.example.com/cart",
"cta_text": "Resume checkout",
"variant": "b",
"priority": 40,
"active": true,
"metadata": {
"experiment": "winback-q3"
}
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/personalization/slots"
payload = {
"slot": "hero-banner",
"segment_label": "at_risk",
"content": "<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>",
"cta_url": "https://shop.example.com/cart",
"cta_text": "Resume checkout",
"variant": "b",
"priority": 40,
"active": True,
"metadata": { "experiment": "winback-q3" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slot: 'hero-banner',
segment_label: 'at_risk',
content: '<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>',
cta_url: 'https://shop.example.com/cart',
cta_text: 'Resume checkout',
variant: 'b',
priority: 40,
active: true,
metadata: {experiment: 'winback-q3'}
})
};
fetch('https://api.orbit.devotel.io/api/v1/personalization/slots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orbit.devotel.io/api/v1/personalization/slots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'slot' => 'hero-banner',
'segment_label' => 'at_risk',
'content' => '<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>',
'cta_url' => 'https://shop.example.com/cart',
'cta_text' => 'Resume checkout',
'variant' => 'b',
'priority' => 40,
'active' => true,
'metadata' => [
'experiment' => 'winback-q3'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/personalization/slots"
payload := strings.NewReader("{\n \"slot\": \"hero-banner\",\n \"segment_label\": \"at_risk\",\n \"content\": \"<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>\",\n \"cta_url\": \"https://shop.example.com/cart\",\n \"cta_text\": \"Resume checkout\",\n \"variant\": \"b\",\n \"priority\": 40,\n \"active\": true,\n \"metadata\": {\n \"experiment\": \"winback-q3\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.orbit.devotel.io/api/v1/personalization/slots")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slot\": \"hero-banner\",\n \"segment_label\": \"at_risk\",\n \"content\": \"<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>\",\n \"cta_url\": \"https://shop.example.com/cart\",\n \"cta_text\": \"Resume checkout\",\n \"variant\": \"b\",\n \"priority\": 40,\n \"active\": true,\n \"metadata\": {\n \"experiment\": \"winback-q3\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/personalization/slots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slot\": \"hero-banner\",\n \"segment_label\": \"at_risk\",\n \"content\": \"<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>\",\n \"cta_url\": \"https://shop.example.com/cart\",\n \"cta_text\": \"Resume checkout\",\n \"variant\": \"b\",\n \"priority\": 40,\n \"active\": true,\n \"metadata\": {\n \"experiment\": \"winback-q3\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "<string>",
"status": 429,
"retry_after": 2
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}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.
curl --request POST \
--url https://api.orbit.devotel.io/api/v1/personalization/slots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slot": "hero-banner",
"segment_label": "at_risk",
"content": "<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>",
"cta_url": "https://shop.example.com/cart",
"cta_text": "Resume checkout",
"variant": "b",
"priority": 40,
"active": true,
"metadata": {
"experiment": "winback-q3"
}
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/personalization/slots"
payload = {
"slot": "hero-banner",
"segment_label": "at_risk",
"content": "<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>",
"cta_url": "https://shop.example.com/cart",
"cta_text": "Resume checkout",
"variant": "b",
"priority": 40,
"active": True,
"metadata": { "experiment": "winback-q3" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slot: 'hero-banner',
segment_label: 'at_risk',
content: '<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>',
cta_url: 'https://shop.example.com/cart',
cta_text: 'Resume checkout',
variant: 'b',
priority: 40,
active: true,
metadata: {experiment: 'winback-q3'}
})
};
fetch('https://api.orbit.devotel.io/api/v1/personalization/slots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orbit.devotel.io/api/v1/personalization/slots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'slot' => 'hero-banner',
'segment_label' => 'at_risk',
'content' => '<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>',
'cta_url' => 'https://shop.example.com/cart',
'cta_text' => 'Resume checkout',
'variant' => 'b',
'priority' => 40,
'active' => true,
'metadata' => [
'experiment' => 'winback-q3'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/personalization/slots"
payload := strings.NewReader("{\n \"slot\": \"hero-banner\",\n \"segment_label\": \"at_risk\",\n \"content\": \"<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>\",\n \"cta_url\": \"https://shop.example.com/cart\",\n \"cta_text\": \"Resume checkout\",\n \"variant\": \"b\",\n \"priority\": 40,\n \"active\": true,\n \"metadata\": {\n \"experiment\": \"winback-q3\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.orbit.devotel.io/api/v1/personalization/slots")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slot\": \"hero-banner\",\n \"segment_label\": \"at_risk\",\n \"content\": \"<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>\",\n \"cta_url\": \"https://shop.example.com/cart\",\n \"cta_text\": \"Resume checkout\",\n \"variant\": \"b\",\n \"priority\": 40,\n \"active\": true,\n \"metadata\": {\n \"experiment\": \"winback-q3\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/personalization/slots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slot\": \"hero-banner\",\n \"segment_label\": \"at_risk\",\n \"content\": \"<h2>We kept your cart warm</h2><p>Finish checkout today and take 15% off.</p>\",\n \"cta_url\": \"https://shop.example.com/cart\",\n \"cta_text\": \"Resume checkout\",\n \"variant\": \"b\",\n \"priority\": 40,\n \"active\": true,\n \"metadata\": {\n \"experiment\": \"winback-q3\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "<string>",
"status": 429,
"retry_after": 2
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"details": {}
},
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docs_url": "<string>"
}
}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 — see Test mode explained for the full credential-header matrix and worked samples. 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.