Update session
curl --request PATCH \
--url https://api.galtea.ai/sessions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customId": "custom_session_123",
"stoppingReason": "GOAL_ACHIEVED",
"error": "External API responded with HTTP 422",
"recordingUri": "audio/org_123/session_abc-recording.mp3",
"status": "COMPLETED",
"metadata": {
"key": "value"
},
"id": "<string>",
"versionId": "<string>",
"userId": "<string>",
"testCaseId": "<string>",
"context": {},
"isProduction": true,
"runId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.galtea.ai/sessions/{id}"
payload = {
"customId": "custom_session_123",
"stoppingReason": "GOAL_ACHIEVED",
"error": "External API responded with HTTP 422",
"recordingUri": "audio/org_123/session_abc-recording.mp3",
"status": "COMPLETED",
"metadata": { "key": "value" },
"id": "<string>",
"versionId": "<string>",
"userId": "<string>",
"testCaseId": "<string>",
"context": {},
"isProduction": True,
"runId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customId: 'custom_session_123',
stoppingReason: 'GOAL_ACHIEVED',
error: 'External API responded with HTTP 422',
recordingUri: 'audio/org_123/session_abc-recording.mp3',
status: 'COMPLETED',
metadata: {key: 'value'},
id: '<string>',
versionId: '<string>',
userId: '<string>',
testCaseId: '<string>',
context: {},
isProduction: true,
runId: '<string>',
createdAt: '2023-11-07T05:31:56Z',
deletedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.galtea.ai/sessions/{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.galtea.ai/sessions/{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([
'customId' => 'custom_session_123',
'stoppingReason' => 'GOAL_ACHIEVED',
'error' => 'External API responded with HTTP 422',
'recordingUri' => 'audio/org_123/session_abc-recording.mp3',
'status' => 'COMPLETED',
'metadata' => [
'key' => 'value'
],
'id' => '<string>',
'versionId' => '<string>',
'userId' => '<string>',
'testCaseId' => '<string>',
'context' => [
],
'isProduction' => true,
'runId' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'deletedAt' => '2023-11-07T05:31:56Z'
]),
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.galtea.ai/sessions/{id}"
payload := strings.NewReader("{\n \"customId\": \"custom_session_123\",\n \"stoppingReason\": \"GOAL_ACHIEVED\",\n \"error\": \"External API responded with HTTP 422\",\n \"recordingUri\": \"audio/org_123/session_abc-recording.mp3\",\n \"status\": \"COMPLETED\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"<string>\",\n \"versionId\": \"<string>\",\n \"userId\": \"<string>\",\n \"testCaseId\": \"<string>\",\n \"context\": {},\n \"isProduction\": true,\n \"runId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.galtea.ai/sessions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customId\": \"custom_session_123\",\n \"stoppingReason\": \"GOAL_ACHIEVED\",\n \"error\": \"External API responded with HTTP 422\",\n \"recordingUri\": \"audio/org_123/session_abc-recording.mp3\",\n \"status\": \"COMPLETED\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"<string>\",\n \"versionId\": \"<string>\",\n \"userId\": \"<string>\",\n \"testCaseId\": \"<string>\",\n \"context\": {},\n \"isProduction\": true,\n \"runId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/sessions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customId\": \"custom_session_123\",\n \"stoppingReason\": \"GOAL_ACHIEVED\",\n \"error\": \"External API responded with HTTP 422\",\n \"recordingUri\": \"audio/org_123/session_abc-recording.mp3\",\n \"status\": \"COMPLETED\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"<string>\",\n \"versionId\": \"<string>\",\n \"userId\": \"<string>\",\n \"testCaseId\": \"<string>\",\n \"context\": {},\n \"isProduction\": true,\n \"runId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "session_123",
"customId": "custom_session_123",
"versionId": "ver_123",
"userId": "user_123",
"testCaseId": "tc_123",
"context": {
"value": "Session context information"
},
"stoppingReason": "GOAL_ACHIEVED",
"recordingUri": "https://files.galtea.ai/audio/org_123/session_abc-recording.mp3",
"error": "External API responded with HTTP 422: Unprocessable Entity — {\"detail\":\"model not found\"}",
"status": "PENDING",
"isProduction": false,
"isSeed": false,
"runId": "run_123",
"endUser": "customer_42",
"deletedAt": "2023-11-07T05:31:56Z",
"metadata": {
"key": "value"
},
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}Update session
Update an existing session. A field the body leaves out keeps its value. See Sessions.
PATCH
/
sessions
/
{id}
Update session
curl --request PATCH \
--url https://api.galtea.ai/sessions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customId": "custom_session_123",
"stoppingReason": "GOAL_ACHIEVED",
"error": "External API responded with HTTP 422",
"recordingUri": "audio/org_123/session_abc-recording.mp3",
"status": "COMPLETED",
"metadata": {
"key": "value"
},
"id": "<string>",
"versionId": "<string>",
"userId": "<string>",
"testCaseId": "<string>",
"context": {},
"isProduction": true,
"runId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.galtea.ai/sessions/{id}"
payload = {
"customId": "custom_session_123",
"stoppingReason": "GOAL_ACHIEVED",
"error": "External API responded with HTTP 422",
"recordingUri": "audio/org_123/session_abc-recording.mp3",
"status": "COMPLETED",
"metadata": { "key": "value" },
"id": "<string>",
"versionId": "<string>",
"userId": "<string>",
"testCaseId": "<string>",
"context": {},
"isProduction": True,
"runId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customId: 'custom_session_123',
stoppingReason: 'GOAL_ACHIEVED',
error: 'External API responded with HTTP 422',
recordingUri: 'audio/org_123/session_abc-recording.mp3',
status: 'COMPLETED',
metadata: {key: 'value'},
id: '<string>',
versionId: '<string>',
userId: '<string>',
testCaseId: '<string>',
context: {},
isProduction: true,
runId: '<string>',
createdAt: '2023-11-07T05:31:56Z',
deletedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.galtea.ai/sessions/{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.galtea.ai/sessions/{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([
'customId' => 'custom_session_123',
'stoppingReason' => 'GOAL_ACHIEVED',
'error' => 'External API responded with HTTP 422',
'recordingUri' => 'audio/org_123/session_abc-recording.mp3',
'status' => 'COMPLETED',
'metadata' => [
'key' => 'value'
],
'id' => '<string>',
'versionId' => '<string>',
'userId' => '<string>',
'testCaseId' => '<string>',
'context' => [
],
'isProduction' => true,
'runId' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'deletedAt' => '2023-11-07T05:31:56Z'
]),
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.galtea.ai/sessions/{id}"
payload := strings.NewReader("{\n \"customId\": \"custom_session_123\",\n \"stoppingReason\": \"GOAL_ACHIEVED\",\n \"error\": \"External API responded with HTTP 422\",\n \"recordingUri\": \"audio/org_123/session_abc-recording.mp3\",\n \"status\": \"COMPLETED\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"<string>\",\n \"versionId\": \"<string>\",\n \"userId\": \"<string>\",\n \"testCaseId\": \"<string>\",\n \"context\": {},\n \"isProduction\": true,\n \"runId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.galtea.ai/sessions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customId\": \"custom_session_123\",\n \"stoppingReason\": \"GOAL_ACHIEVED\",\n \"error\": \"External API responded with HTTP 422\",\n \"recordingUri\": \"audio/org_123/session_abc-recording.mp3\",\n \"status\": \"COMPLETED\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"<string>\",\n \"versionId\": \"<string>\",\n \"userId\": \"<string>\",\n \"testCaseId\": \"<string>\",\n \"context\": {},\n \"isProduction\": true,\n \"runId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/sessions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customId\": \"custom_session_123\",\n \"stoppingReason\": \"GOAL_ACHIEVED\",\n \"error\": \"External API responded with HTTP 422\",\n \"recordingUri\": \"audio/org_123/session_abc-recording.mp3\",\n \"status\": \"COMPLETED\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"<string>\",\n \"versionId\": \"<string>\",\n \"userId\": \"<string>\",\n \"testCaseId\": \"<string>\",\n \"context\": {},\n \"isProduction\": true,\n \"runId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "session_123",
"customId": "custom_session_123",
"versionId": "ver_123",
"userId": "user_123",
"testCaseId": "tc_123",
"context": {
"value": "Session context information"
},
"stoppingReason": "GOAL_ACHIEVED",
"recordingUri": "https://files.galtea.ai/audio/org_123/session_abc-recording.mp3",
"error": "External API responded with HTTP 422: Unprocessable Entity — {\"detail\":\"model not found\"}",
"status": "PENDING",
"isProduction": false,
"isSeed": false,
"runId": "run_123",
"endUser": "customer_42",
"deletedAt": "2023-11-07T05:31:56Z",
"metadata": {
"key": "value"
},
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}You are reading the docs of Galtea 5.22. Read this page in the latest version.
Authorizations
Headers
Body
application/json
Response
Session updated successfully. The body is the resource as its GET answers it.
Storage URI of the full-call recording for a telephony-evaluation session, returned under STORAGE_PUBLIC_BASE_URL when the deployment configures one. Null for non-telephony sessions or before the recording is processed. Resolve to a playable URL via GET /storage?uri=.
Example:
"https://files.galtea.ai/audio/org_123/session_abc-recording.mp3"