Close Session
curl --request POST \
--url https://openapi.akool.com/api/open/v4/liveAvatar/session/close \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"id": "6698c9d69cf7b0d61d1b6420"
}
'import requests
url = "https://openapi.akool.com/api/open/v4/liveAvatar/session/close"
payload = { "id": "6698c9d69cf7b0d61d1b6420" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '6698c9d69cf7b0d61d1b6420'})
};
fetch('https://openapi.akool.com/api/open/v4/liveAvatar/session/close', 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://openapi.akool.com/api/open/v4/liveAvatar/session/close",
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([
'id' => '6698c9d69cf7b0d61d1b6420'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://openapi.akool.com/api/open/v4/liveAvatar/session/close"
payload := strings.NewReader("{\n \"id\": \"6698c9d69cf7b0d61d1b6420\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://openapi.akool.com/api/open/v4/liveAvatar/session/close")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"6698c9d69cf7b0d61d1b6420\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.akool.com/api/open/v4/liveAvatar/session/close")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"6698c9d69cf7b0d61d1b6420\"\n}"
response = http.request(request)
puts response.read_body{
"code": 1000,
"msg": "OK"
}API Endpoints
Close Session
Close an active streaming avatar session
POST
/
api
/
open
/
v4
/
liveAvatar
/
session
/
close
Close Session
curl --request POST \
--url https://openapi.akool.com/api/open/v4/liveAvatar/session/close \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"id": "6698c9d69cf7b0d61d1b6420"
}
'import requests
url = "https://openapi.akool.com/api/open/v4/liveAvatar/session/close"
payload = { "id": "6698c9d69cf7b0d61d1b6420" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '6698c9d69cf7b0d61d1b6420'})
};
fetch('https://openapi.akool.com/api/open/v4/liveAvatar/session/close', 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://openapi.akool.com/api/open/v4/liveAvatar/session/close",
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([
'id' => '6698c9d69cf7b0d61d1b6420'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://openapi.akool.com/api/open/v4/liveAvatar/session/close"
payload := strings.NewReader("{\n \"id\": \"6698c9d69cf7b0d61d1b6420\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://openapi.akool.com/api/open/v4/liveAvatar/session/close")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"6698c9d69cf7b0d61d1b6420\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.akool.com/api/open/v4/liveAvatar/session/close")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"6698c9d69cf7b0d61d1b6420\"\n}"
response = http.request(request)
puts response.read_body{
"code": 1000,
"msg": "OK"
}Both the avatar_id and voice_id can be easily obtained by copying them directly from the web interface. You can also create and manage your streaming avatars using our intuitive web platform.Create and manage your avatars at: https://akool.com/apps/upload/avatar?from=%2Fapps%2Fstreaming-avatar%2Fedit
Authorizations
ApiKeyAuthBearerAuth
Your API Key used for request authorization. If both Authorization and x-api-key have values, Authorization will be used first and x-api-key will be discarded.
Body
application/json
Session ID from the _id field returned by Create Session