Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl --request PATCH \
--url http://localhost:8000/api/sessions/{session_id} \
--header 'Content-Type: application/json' \
--data '
{
"ended_at": "2023-11-07T05:31:56Z",
"duration": 123,
"metadata": {}
}
'import requests
url = "http://localhost:8000/api/sessions/{session_id}"
payload = {
"ended_at": "2023-11-07T05:31:56Z",
"duration": 123,
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ended_at: '2023-11-07T05:31:56Z', duration: 123, metadata: {}})
};
fetch('http://localhost:8000/api/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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ended_at' => '2023-11-07T05:31:56Z',
'duration' => 123,
'metadata' => [
]
]),
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 := "http://localhost:8000/api/sessions/{session_id}"
payload := strings.NewReader("{\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"duration\": 123,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8000/api/sessions/{session_id}")
.header("Content-Type", "application/json")
.body("{\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"duration\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"duration\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"room_name": "<string>",
"id": "<string>",
"status": "CREATED",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration": 123,
"user_id": "<string>",
"agent_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"session_data": {},
"agent_name": "<string>",
"call_direction": "INBOUND",
"outbound_phone_number": "<string>",
"call_status": "RINGING",
"analysis": {},
"transferred_to": "<string>",
"transfer_type": "WARM",
"transfer_timestamp": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Update a session.
curl --request PATCH \
--url http://localhost:8000/api/sessions/{session_id} \
--header 'Content-Type: application/json' \
--data '
{
"ended_at": "2023-11-07T05:31:56Z",
"duration": 123,
"metadata": {}
}
'import requests
url = "http://localhost:8000/api/sessions/{session_id}"
payload = {
"ended_at": "2023-11-07T05:31:56Z",
"duration": 123,
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ended_at: '2023-11-07T05:31:56Z', duration: 123, metadata: {}})
};
fetch('http://localhost:8000/api/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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ended_at' => '2023-11-07T05:31:56Z',
'duration' => 123,
'metadata' => [
]
]),
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 := "http://localhost:8000/api/sessions/{session_id}"
payload := strings.NewReader("{\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"duration\": 123,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8000/api/sessions/{session_id}")
.header("Content-Type", "application/json")
.body("{\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"duration\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ended_at\": \"2023-11-07T05:31:56Z\",\n \"duration\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"room_name": "<string>",
"id": "<string>",
"status": "CREATED",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration": 123,
"user_id": "<string>",
"agent_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"session_data": {},
"agent_name": "<string>",
"call_direction": "INBOUND",
"outbound_phone_number": "<string>",
"call_status": "RINGING",
"analysis": {},
"transferred_to": "<string>",
"transfer_type": "WARM",
"transfer_timestamp": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Successful Response
CREATED, ACTIVE, COMPLETED, FAILED INBOUND, OUTBOUND RINGING, ANSWERED, COMPLETED, FAILED, NO_ANSWER WARM, COLD