curl --request PATCH \
--url https://dev.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://dev.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://dev.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://dev.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://dev.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://dev.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://dev.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.
curl --request PATCH \
--url https://dev.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://dev.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://dev.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://dev.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://dev.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://dev.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://dev.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"
}Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Headers
Send return=minimal to get no body back from a write and skip reading the resource: a create answers 201 with only Location, and an update answers 204.
"return=minimal"
Path Parameters
Session ID
"session_123"
Body
"custom_session_123"
"GOAL_ACHIEVED"
"External API responded with HTTP 422"
"audio/org_123/session_abc-recording.mp3"
PENDING, COMPLETED, FAILED "COMPLETED"
Arbitrary metadata, stored as sent.
{ "key": "value" }
Deprecated and ignored: an update never wrote this field.
Deprecated and ignored: an update never wrote this field.
Deprecated and ignored: an update never wrote this field.
Deprecated and ignored: an update never wrote this field.
Deprecated and ignored: an update never wrote this field.
Deprecated and ignored: an update never wrote this field.
Deprecated and ignored: an update never wrote this field.
Deprecated and ignored: an update never wrote this field.
Deprecated and ignored: an update never wrote this field.
Response
Session updated successfully. The body is the resource as its GET answers it.
"session_123"
"custom_session_123"
"ver_123"
"user_123"
"tc_123"
Structured context data. For plain text context, format is { value: "..." }
Show child attributes
Show child attributes
{ "value": "Session context information" }
"GOAL_ACHIEVED"
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=.
"https://files.galtea.ai/audio/org_123/session_abc-recording.mp3"
"External API responded with HTTP 422: Unprocessable Entity — {\"detail\":\"model not found\"}"
PENDING, COMPLETED, FAILED "PENDING"
True when the session represents real production traffic (no associated test case).
false
True when the session holds the predefined conversation of a test case and is never executed. Server-managed and read-only.
false
The run that created this session. Null for a session created outside a launch (production traffic, an imported trace). A session a run only scored names no run here; filter with involvedInRunIds to reach those too.
"run_123"
The end user of the session, set by OTel ingest from the first trace that names one. Read-only.
"customer_42"
Arbitrary metadata, returned as stored. Usually an object, but any JSON value is accepted.
{ "key": "value" }