Start a Support Session
curl --request POST \
--url https://api.example.com/api/v1/apps/:appId/support-sessions \
--header 'Content-Type: application/json' \
--data '
{
"external_user_id": "<string>",
"name": "<string>",
"email": "<string>",
"avatar_url": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/apps/:appId/support-sessions"
payload = {
"external_user_id": "<string>",
"name": "<string>",
"email": "<string>",
"avatar_url": "<string>",
"title": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
external_user_id: '<string>',
name: '<string>',
email: '<string>',
avatar_url: '<string>',
title: '<string>'
})
};
fetch('https://api.example.com/api/v1/apps/:appId/support-sessions', 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.example.com/api/v1/apps/:appId/support-sessions",
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([
'external_user_id' => '<string>',
'name' => '<string>',
'email' => '<string>',
'avatar_url' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/apps/:appId/support-sessions"
payload := strings.NewReader("{\n \"external_user_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"avatar_url\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/apps/:appId/support-sessions")
.header("Content-Type", "application/json")
.body("{\n \"external_user_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"avatar_url\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/apps/:appId/support-sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_user_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"avatar_url\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data.token": "<string>",
"data.conversation_id": "<string>",
"data.user_id": "<string>",
"data.expires_in": 123
}Provisioning
Start a Support Session
Mint an SDK token and open a support conversation in a single backend call.
POST
/
api
/
v1
/
apps
/
:appId
/
support-sessions
Start a Support Session
curl --request POST \
--url https://api.example.com/api/v1/apps/:appId/support-sessions \
--header 'Content-Type: application/json' \
--data '
{
"external_user_id": "<string>",
"name": "<string>",
"email": "<string>",
"avatar_url": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/apps/:appId/support-sessions"
payload = {
"external_user_id": "<string>",
"name": "<string>",
"email": "<string>",
"avatar_url": "<string>",
"title": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
external_user_id: '<string>',
name: '<string>',
email: '<string>',
avatar_url: '<string>',
title: '<string>'
})
};
fetch('https://api.example.com/api/v1/apps/:appId/support-sessions', 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.example.com/api/v1/apps/:appId/support-sessions",
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([
'external_user_id' => '<string>',
'name' => '<string>',
'email' => '<string>',
'avatar_url' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/apps/:appId/support-sessions"
payload := strings.NewReader("{\n \"external_user_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"avatar_url\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/apps/:appId/support-sessions")
.header("Content-Type", "application/json")
.body("{\n \"external_user_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"avatar_url\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/apps/:appId/support-sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_user_id\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"avatar_url\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data.token": "<string>",
"data.conversation_id": "<string>",
"data.user_id": "<string>",
"data.expires_in": 123
}Overview
Starts a support session in one request: it mints a short-lived SDK token and creates (or reuses) a bot-eligibleSUPPORT conversation for the visitor. Your frontend then connects
the SDK/widget with the returned token and conversation_id.
Use this from your backend when you want to provision a widget without exposing your secret
key to the browser. For a no-backend embed, use Anonymous Session
instead.
Auth:
X-Api-Key (pk_…) + X-Api-Secret (sk_…) on production apps. A dashboard JWT is
also accepted for non-production (dev/staging) apps. Never expose the secret to the frontend.Path Parameters
string
required
App ID (UUID).
Request Headers
| Header | Required | Description |
|---|---|---|
X-Api-Key | Yes (or JWT) | App public key (pk_…) |
X-Api-Secret | Yes (or JWT) | App secret key (sk_…) |
Content-Type | Yes | application/json |
Request Body
string
required
Your ID for the visitor. Reused across sessions to keep their history.
string
Visitor display name.
string
Visitor email (optional; can also be collected later).
string
Visitor avatar URL.
string
Optional title for the support conversation.
Example Request
curl -X POST https://dev.vocantly.com/api/v1/apps/YOUR_APP_ID/support-sessions \
-H "Content-Type: application/json" \
-H "X-Api-Key: pk_xxxxx" \
-H "X-Api-Secret: sk_xxxxx" \
-d '{
"external_user_id": "visitor_123",
"name": "Jane Doe",
"email": "jane@example.com"
}'
Response
string
SDK token for the frontend. Use with the SDK or widget.
string
The support conversation to join.
string
Same as
external_user_id.number
Token lifetime in seconds.
Success (201)
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"conversation_id": "b2c8…",
"user_id": "visitor_123",
"expires_in": 86400
}
}
Using the response
// Frontend — hand token + conversationId to the widget
VocantlyWidget.init({
wsUrl: 'wss://ws.dev.vocantly.com/ws',
token,
conversationId,
});
Embed the widget
Drop-in support bubble.
Anonymous Session
No-backend embed with a public key.