curl --request GET \
--url https://api.boson.ai/v1/avatar/sessions/{session_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.boson.ai/v1/avatar/sessions/{session_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.boson.ai/v1/avatar/sessions/{session_id}', 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.boson.ai/v1/avatar/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.boson.ai/v1/avatar/sessions/{session_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.boson.ai/v1/avatar/sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.boson.ai/v1/avatar/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "avrt_3f9c2a7e8b1d4c6f",
"object": "avatar.realtime.session",
"status": "active",
"model": "higgs-avatar",
"avatar_id": "builtin_claire_v1",
"avatar_identity": "boson-avatar-agent",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Retrieve a session
Current state of a session. A session you did not create (with this API key) is reported as not found. Ended sessions stay retrievable until a few minutes after expires_at, then 404.
curl --request GET \
--url https://api.boson.ai/v1/avatar/sessions/{session_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.boson.ai/v1/avatar/sessions/{session_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.boson.ai/v1/avatar/sessions/{session_id}', 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.boson.ai/v1/avatar/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.boson.ai/v1/avatar/sessions/{session_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.boson.ai/v1/avatar/sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.boson.ai/v1/avatar/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "avrt_3f9c2a7e8b1d4c6f",
"object": "avatar.realtime.session",
"status": "active",
"model": "higgs-avatar",
"avatar_id": "builtin_claire_v1",
"avatar_identity": "boson-avatar-agent",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
Your Boson API key, sent as Authorization: Bearer $BOSON_API_KEY.
Path Parameters
The session ID returned by POST /v1/avatar/sessions, e.g. avrt_....
Response
The session object.
A realtime avatar session (the create / retrieve / release response).
Session ID, e.g. avrt_....
"avrt_3f9c2a7e8b1d4c6f"
avatar.realtime.session active: the avatar is in the room. releasing: a release was requested and is not confirmed yet. terminated: the session has ended (released, expired, room emptied, or ended by Boson for another reason).
active, releasing, terminated "higgs-avatar"
"builtin_claire_v1"
The LiveKit identity the avatar joined as (transport.participant_identity).
"boson-avatar-agent"
When the avatar joined the room (ISO 8601, UTC).
Latest end time: the session ends at this time if it is still running (created_at + max_duration_seconds).
When the session ended; null while it is active.