curl --request POST \
--url https://api.galtea.ai/sessions/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"versionId": "ver_123",
"productId": "prod_123",
"originalFilename": "<string>",
"isProduction": true
}
'import requests
url = "https://api.galtea.ai/sessions/import"
payload = {
"text": "<string>",
"versionId": "ver_123",
"productId": "prod_123",
"originalFilename": "<string>",
"isProduction": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
versionId: 'ver_123',
productId: 'prod_123',
originalFilename: '<string>',
isProduction: true
})
};
fetch('https://api.galtea.ai/sessions/import', 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/import",
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([
'text' => '<string>',
'versionId' => 'ver_123',
'productId' => 'prod_123',
'originalFilename' => '<string>',
'isProduction' => true
]),
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/import"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"versionId\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"originalFilename\": \"<string>\",\n \"isProduction\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.galtea.ai/sessions/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"versionId\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"originalFilename\": \"<string>\",\n \"isProduction\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/sessions/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"versionId\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"originalFilename\": \"<string>\",\n \"isProduction\": true\n}"
response = http.request(request)
puts response.read_body{
"jobId": "job_abc123",
"versionId": "ver_123"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Import sessions from a Langfuse trace export
Imports production sessions from a Langfuse export. The content is handed to a background BullMQ job; the response is the jobId to poll on GET /jobs/{jobId}/status. Semantic validation (Langfuse shape, drop rules) happens in the job, so a syntactically valid upload is accepted with 202 and rejections surface as failed job state. Send EITHER multipart/form-data with a file OR application/json with a text string — exactly one. isProduction defaults to true. versionId is optional: when omitted, provide productId and the API reuses the product’s latest version (creating a default first version if the product has none). One of versionId or productId is required.
curl --request POST \
--url https://api.galtea.ai/sessions/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"versionId": "ver_123",
"productId": "prod_123",
"originalFilename": "<string>",
"isProduction": true
}
'import requests
url = "https://api.galtea.ai/sessions/import"
payload = {
"text": "<string>",
"versionId": "ver_123",
"productId": "prod_123",
"originalFilename": "<string>",
"isProduction": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
versionId: 'ver_123',
productId: 'prod_123',
originalFilename: '<string>',
isProduction: true
})
};
fetch('https://api.galtea.ai/sessions/import', 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/import",
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([
'text' => '<string>',
'versionId' => 'ver_123',
'productId' => 'prod_123',
'originalFilename' => '<string>',
'isProduction' => true
]),
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/import"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"versionId\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"originalFilename\": \"<string>\",\n \"isProduction\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.galtea.ai/sessions/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"versionId\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"originalFilename\": \"<string>\",\n \"isProduction\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/sessions/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"versionId\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"originalFilename\": \"<string>\",\n \"isProduction\": true\n}"
response = http.request(request)
puts response.read_body{
"jobId": "job_abc123",
"versionId": "ver_123"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}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-....
Body
The Langfuse trace export as a JSON string.
1Id of the Version the imported sessions belong to. Optional: when omitted, provide productId and the API reuses the product's latest version (creating a default first version if the product has none).
"ver_123"
Id of the Product to anchor the import when versionId is omitted. Ignored when versionId is provided.
"prod_123"
Optional filename to associate with the upload. Defaults to "pasted_trace.json".
Whether the imported sessions are production traffic. Defaults to true.
Response
Import accepted; poll the returned jobId for completion.
Id of the BullMQ job processing the import. Poll GET /jobs/{jobId}/status for state.
"job_abc123"
Id of the Version the imported sessions will belong to: the versionId sent in the request, or the version resolved from productId (issue #3011).
"ver_123"