curl --request POST \
--url https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"participantName": "عائشہ صدیقی",
"roomName": "shifa-clinic"
}
'import requests
url = "https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session"
payload = {
"participantName": "عائشہ صدیقی",
"roomName": "shifa-clinic"
}
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({participantName: 'عائشہ صدیقی', roomName: 'shifa-clinic'})
};
fetch('https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session', 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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session",
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([
'participantName' => 'عائشہ صدیقی',
'roomName' => 'shifa-clinic'
]),
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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session"
payload := strings.NewReader("{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic\"\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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session")
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 \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6…",
"wsUrl": "wss://upliftai-prod-yd34to8b.livekit.cloud",
"roomName": "shifa-clinic-f2c14cfc-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}{
"message": [
"participantName should not be empty",
"participantName must be a string"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "invalid authorization",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Insufficient credits to start a realtime session",
"error": "Payment Required",
"statusCode": 402
}{
"message": "Forbidden resource",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Realtime assistant not found: 00000000-0000-4000-8000-000000000000",
"error": "Not Found",
"statusCode": 404
}{
"message": "Published version 14 of assistant 0f4a91d3-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not readable yet",
"statusCode": 503
}Create a web session token
Mint a LiveKit token for a browser or mobile client to talk to a stored assistant. It is a standard LiveKit token — connect to wsUrl with any LiveKit client SDK or UI component library and the assistant joins the room on its own. The token is good for the assistant’s config.session.ttl, 600 seconds by default — that caps how long the client has to connect, not how long the conversation can run, so mint one token per conversation. The session record is written when the token is minted, so an unused token still leaves a session behind.
curl --request POST \
--url https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"participantName": "عائشہ صدیقی",
"roomName": "shifa-clinic"
}
'import requests
url = "https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session"
payload = {
"participantName": "عائشہ صدیقی",
"roomName": "shifa-clinic"
}
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({participantName: 'عائشہ صدیقی', roomName: 'shifa-clinic'})
};
fetch('https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session', 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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session",
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([
'participantName' => 'عائشہ صدیقی',
'roomName' => 'shifa-clinic'
]),
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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session"
payload := strings.NewReader("{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic\"\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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/session")
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 \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6…",
"wsUrl": "wss://upliftai-prod-yd34to8b.livekit.cloud",
"roomName": "shifa-clinic-f2c14cfc-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}{
"message": [
"participantName should not be empty",
"participantName must be a string"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "invalid authorization",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Insufficient credits to start a realtime session",
"error": "Payment Required",
"statusCode": 402
}{
"message": "Forbidden resource",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Realtime assistant not found: 00000000-0000-4000-8000-000000000000",
"error": "Not Found",
"statusCode": 404
}{
"message": "Published version 14 of assistant 0f4a91d3-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not readable yet",
"statusCode": 503
}Authorizations
Project API key (sk_api_…).
Path Parameters
Body
The LiveKit participant identity the client joins under. Stored on the session record as participantIdentity.
1Cosmetic prefix for the generated room name, truncated to its first 15 characters. Overrides the assistant's config.session.roomPrefix; with neither set the prefix is web.
Which version of the assistant runs. prod is the published version, or the draft before the first publish. draft tries unpublished edits on a real conversation. A number runs that exact published version, and one never published is a 404. Send a number as a JSON number, not a string.
prod, draft "draft"
Facts about the person on this session. They reach the model as a caller record and come back verbatim on every session read. Same limits as on a call. The rendered record rides in the returned token, so the browser can read it. Keep secrets out.
Appended to the assistant's instructions for this session only. It rides in the returned token, so the browser can read it. Keep secrets out.
2000