curl --request POST \
--url https://api.galtea.ai/endpointConnections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "prod_123",
"name": "My API Connection",
"url": "https://api.example.com/v1/chat/completions",
"httpMethod": "POST",
"authType": "BEARER",
"inputTemplate": "{\"prompt\": \"{{ input.user_message }}\"}",
"outputMapping": {
"output": "$.choices[0].message.content",
"output_files": "$.files"
},
"id": "ec_123",
"userId": "user_123",
"hasAuthToken": true,
"username": "<string>",
"hasPassword": true,
"headers": {
"Content-Type": "application/json"
},
"inputSchema": {
"type": "object",
"properties": {
"user_message": {
"type": "string",
"description": "The main user message to the agent"
},
"reasoning_level": {
"type": "string",
"enum": [
"low",
"medium",
"high"
],
"description": "How much reasoning the agent should apply"
},
"topic": {
"type": "string",
"enum": [
"billing",
"shipping",
"returns",
"account"
],
"description": "Conversation topic"
},
"customer_id": {
"type": "string",
"pattern": "^C-\\d{3,6}$",
"description": "Customer identifier"
}
},
"required": [
"user_message"
]
},
"type": "CONVERSATION",
"timeout": 15,
"rateLimit": 60,
"retryEnabled": true,
"retryMaxAttempts": 1,
"retryInitialDelayMs": 1000,
"retryBackoffStrategy": "EXPONENTIAL",
"retryMaxDelayMs": 3000,
"retryableStatusCodes": [
429,
500,
502,
503,
504
],
"acknowledgedInsecureHttp": false,
"conversationEndRules": [],
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.galtea.ai/endpointConnections"
payload = {
"productId": "prod_123",
"name": "My API Connection",
"url": "https://api.example.com/v1/chat/completions",
"httpMethod": "POST",
"authType": "BEARER",
"inputTemplate": "{\"prompt\": \"{{ input.user_message }}\"}",
"outputMapping": {
"output": "$.choices[0].message.content",
"output_files": "$.files"
},
"id": "ec_123",
"userId": "user_123",
"hasAuthToken": True,
"username": "<string>",
"hasPassword": True,
"headers": { "Content-Type": "application/json" },
"inputSchema": {
"type": "object",
"properties": {
"user_message": {
"type": "string",
"description": "The main user message to the agent"
},
"reasoning_level": {
"type": "string",
"enum": ["low", "medium", "high"],
"description": "How much reasoning the agent should apply"
},
"topic": {
"type": "string",
"enum": ["billing", "shipping", "returns", "account"],
"description": "Conversation topic"
},
"customer_id": {
"type": "string",
"pattern": "^C-\d{3,6}$",
"description": "Customer identifier"
}
},
"required": ["user_message"]
},
"type": "CONVERSATION",
"timeout": 15,
"rateLimit": 60,
"retryEnabled": True,
"retryMaxAttempts": 1,
"retryInitialDelayMs": 1000,
"retryBackoffStrategy": "EXPONENTIAL",
"retryMaxDelayMs": 3000,
"retryableStatusCodes": [429, 500, 502, 503, 504],
"acknowledgedInsecureHttp": False,
"conversationEndRules": [],
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
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({
productId: 'prod_123',
name: 'My API Connection',
url: 'https://api.example.com/v1/chat/completions',
httpMethod: 'POST',
authType: 'BEARER',
inputTemplate: '{"prompt": "{{ input.user_message }}"}',
outputMapping: {output: '$.choices[0].message.content', output_files: '$.files'},
id: 'ec_123',
userId: 'user_123',
hasAuthToken: true,
username: '<string>',
hasPassword: true,
headers: {'Content-Type': 'application/json'},
inputSchema: {
type: 'object',
properties: {
user_message: {type: 'string', description: 'The main user message to the agent'},
reasoning_level: {
type: 'string',
enum: ['low', 'medium', 'high'],
description: 'How much reasoning the agent should apply'
},
topic: {
type: 'string',
enum: ['billing', 'shipping', 'returns', 'account'],
description: 'Conversation topic'
},
customer_id: {type: 'string', pattern: '^C-\d{3,6}$', description: 'Customer identifier'}
},
required: ['user_message']
},
type: 'CONVERSATION',
timeout: 15,
rateLimit: 60,
retryEnabled: true,
retryMaxAttempts: 1,
retryInitialDelayMs: 1000,
retryBackoffStrategy: 'EXPONENTIAL',
retryMaxDelayMs: 3000,
retryableStatusCodes: [429, 500, 502, 503, 504],
acknowledgedInsecureHttp: false,
conversationEndRules: [],
createdAt: '2023-11-07T05:31:56Z',
deletedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.galtea.ai/endpointConnections', 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/endpointConnections",
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([
'productId' => 'prod_123',
'name' => 'My API Connection',
'url' => 'https://api.example.com/v1/chat/completions',
'httpMethod' => 'POST',
'authType' => 'BEARER',
'inputTemplate' => '{"prompt": "{{ input.user_message }}"}',
'outputMapping' => [
'output' => '$.choices[0].message.content',
'output_files' => '$.files'
],
'id' => 'ec_123',
'userId' => 'user_123',
'hasAuthToken' => true,
'username' => '<string>',
'hasPassword' => true,
'headers' => [
'Content-Type' => 'application/json'
],
'inputSchema' => [
'type' => 'object',
'properties' => [
'user_message' => [
'type' => 'string',
'description' => 'The main user message to the agent'
],
'reasoning_level' => [
'type' => 'string',
'enum' => [
'low',
'medium',
'high'
],
'description' => 'How much reasoning the agent should apply'
],
'topic' => [
'type' => 'string',
'enum' => [
'billing',
'shipping',
'returns',
'account'
],
'description' => 'Conversation topic'
],
'customer_id' => [
'type' => 'string',
'pattern' => '^C-\\d{3,6}$',
'description' => 'Customer identifier'
]
],
'required' => [
'user_message'
]
],
'type' => 'CONVERSATION',
'timeout' => 15,
'rateLimit' => 60,
'retryEnabled' => true,
'retryMaxAttempts' => 1,
'retryInitialDelayMs' => 1000,
'retryBackoffStrategy' => 'EXPONENTIAL',
'retryMaxDelayMs' => 3000,
'retryableStatusCodes' => [
429,
500,
502,
503,
504
],
'acknowledgedInsecureHttp' => false,
'conversationEndRules' => [
],
'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/endpointConnections"
payload := strings.NewReader("{\n \"productId\": \"prod_123\",\n \"name\": \"My API Connection\",\n \"url\": \"https://api.example.com/v1/chat/completions\",\n \"httpMethod\": \"POST\",\n \"authType\": \"BEARER\",\n \"inputTemplate\": \"{\\\"prompt\\\": \\\"{{ input.user_message }}\\\"}\",\n \"outputMapping\": {\n \"output\": \"$.choices[0].message.content\",\n \"output_files\": \"$.files\"\n },\n \"id\": \"ec_123\",\n \"userId\": \"user_123\",\n \"hasAuthToken\": true,\n \"username\": \"<string>\",\n \"hasPassword\": true,\n \"headers\": {\n \"Content-Type\": \"application/json\"\n },\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user_message\": {\n \"type\": \"string\",\n \"description\": \"The main user message to the agent\"\n },\n \"reasoning_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"low\",\n \"medium\",\n \"high\"\n ],\n \"description\": \"How much reasoning the agent should apply\"\n },\n \"topic\": {\n \"type\": \"string\",\n \"enum\": [\n \"billing\",\n \"shipping\",\n \"returns\",\n \"account\"\n ],\n \"description\": \"Conversation topic\"\n },\n \"customer_id\": {\n \"type\": \"string\",\n \"pattern\": \"^C-\\\\d{3,6}$\",\n \"description\": \"Customer identifier\"\n }\n },\n \"required\": [\n \"user_message\"\n ]\n },\n \"type\": \"CONVERSATION\",\n \"timeout\": 15,\n \"rateLimit\": 60,\n \"retryEnabled\": true,\n \"retryMaxAttempts\": 1,\n \"retryInitialDelayMs\": 1000,\n \"retryBackoffStrategy\": \"EXPONENTIAL\",\n \"retryMaxDelayMs\": 3000,\n \"retryableStatusCodes\": [\n 429,\n 500,\n 502,\n 503,\n 504\n ],\n \"acknowledgedInsecureHttp\": false,\n \"conversationEndRules\": [],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\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/endpointConnections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"prod_123\",\n \"name\": \"My API Connection\",\n \"url\": \"https://api.example.com/v1/chat/completions\",\n \"httpMethod\": \"POST\",\n \"authType\": \"BEARER\",\n \"inputTemplate\": \"{\\\"prompt\\\": \\\"{{ input.user_message }}\\\"}\",\n \"outputMapping\": {\n \"output\": \"$.choices[0].message.content\",\n \"output_files\": \"$.files\"\n },\n \"id\": \"ec_123\",\n \"userId\": \"user_123\",\n \"hasAuthToken\": true,\n \"username\": \"<string>\",\n \"hasPassword\": true,\n \"headers\": {\n \"Content-Type\": \"application/json\"\n },\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user_message\": {\n \"type\": \"string\",\n \"description\": \"The main user message to the agent\"\n },\n \"reasoning_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"low\",\n \"medium\",\n \"high\"\n ],\n \"description\": \"How much reasoning the agent should apply\"\n },\n \"topic\": {\n \"type\": \"string\",\n \"enum\": [\n \"billing\",\n \"shipping\",\n \"returns\",\n \"account\"\n ],\n \"description\": \"Conversation topic\"\n },\n \"customer_id\": {\n \"type\": \"string\",\n \"pattern\": \"^C-\\\\d{3,6}$\",\n \"description\": \"Customer identifier\"\n }\n },\n \"required\": [\n \"user_message\"\n ]\n },\n \"type\": \"CONVERSATION\",\n \"timeout\": 15,\n \"rateLimit\": 60,\n \"retryEnabled\": true,\n \"retryMaxAttempts\": 1,\n \"retryInitialDelayMs\": 1000,\n \"retryBackoffStrategy\": \"EXPONENTIAL\",\n \"retryMaxDelayMs\": 3000,\n \"retryableStatusCodes\": [\n 429,\n 500,\n 502,\n 503,\n 504\n ],\n \"acknowledgedInsecureHttp\": false,\n \"conversationEndRules\": [],\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/endpointConnections")
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 \"productId\": \"prod_123\",\n \"name\": \"My API Connection\",\n \"url\": \"https://api.example.com/v1/chat/completions\",\n \"httpMethod\": \"POST\",\n \"authType\": \"BEARER\",\n \"inputTemplate\": \"{\\\"prompt\\\": \\\"{{ input.user_message }}\\\"}\",\n \"outputMapping\": {\n \"output\": \"$.choices[0].message.content\",\n \"output_files\": \"$.files\"\n },\n \"id\": \"ec_123\",\n \"userId\": \"user_123\",\n \"hasAuthToken\": true,\n \"username\": \"<string>\",\n \"hasPassword\": true,\n \"headers\": {\n \"Content-Type\": \"application/json\"\n },\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user_message\": {\n \"type\": \"string\",\n \"description\": \"The main user message to the agent\"\n },\n \"reasoning_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"low\",\n \"medium\",\n \"high\"\n ],\n \"description\": \"How much reasoning the agent should apply\"\n },\n \"topic\": {\n \"type\": \"string\",\n \"enum\": [\n \"billing\",\n \"shipping\",\n \"returns\",\n \"account\"\n ],\n \"description\": \"Conversation topic\"\n },\n \"customer_id\": {\n \"type\": \"string\",\n \"pattern\": \"^C-\\\\d{3,6}$\",\n \"description\": \"Customer identifier\"\n }\n },\n \"required\": [\n \"user_message\"\n ]\n },\n \"type\": \"CONVERSATION\",\n \"timeout\": 15,\n \"rateLimit\": 60,\n \"retryEnabled\": true,\n \"retryMaxAttempts\": 1,\n \"retryInitialDelayMs\": 1000,\n \"retryBackoffStrategy\": \"EXPONENTIAL\",\n \"retryMaxDelayMs\": 3000,\n \"retryableStatusCodes\": [\n 429,\n 500,\n 502,\n 503,\n 504\n ],\n \"acknowledgedInsecureHttp\": false,\n \"conversationEndRules\": [],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"productId": "prod_123",
"name": "My API Connection",
"url": "https://api.example.com/v1/chat/completions",
"httpMethod": "POST",
"authType": "BEARER",
"inputTemplate": "{\"prompt\": \"{{ input.user_message }}\"}",
"outputMapping": {
"output": "$.choices[0].message.content",
"output_files": "$.files"
},
"id": "ec_123",
"userId": "user_123",
"hasAuthToken": true,
"username": "<string>",
"hasPassword": true,
"headers": {
"Content-Type": "application/json"
},
"inputSchema": {
"type": "object",
"properties": {
"user_message": {
"type": "string",
"description": "The main user message to the agent"
},
"reasoning_level": {
"type": "string",
"enum": [
"low",
"medium",
"high"
],
"description": "How much reasoning the agent should apply"
},
"topic": {
"type": "string",
"enum": [
"billing",
"shipping",
"returns",
"account"
],
"description": "Conversation topic"
},
"customer_id": {
"type": "string",
"pattern": "^C-\\d{3,6}$",
"description": "Customer identifier"
}
},
"required": [
"user_message"
]
},
"type": "CONVERSATION",
"timeout": 15,
"rateLimit": 60,
"retryEnabled": true,
"retryMaxAttempts": 1,
"retryInitialDelayMs": 1000,
"retryBackoffStrategy": "EXPONENTIAL",
"retryMaxDelayMs": 3000,
"retryableStatusCodes": [
429,
500,
502,
503,
504
],
"acknowledgedInsecureHttp": false,
"conversationEndRules": [],
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}Create endpoint connection
Create a new endpoint connection. See Endpoint Connections.
curl --request POST \
--url https://api.galtea.ai/endpointConnections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "prod_123",
"name": "My API Connection",
"url": "https://api.example.com/v1/chat/completions",
"httpMethod": "POST",
"authType": "BEARER",
"inputTemplate": "{\"prompt\": \"{{ input.user_message }}\"}",
"outputMapping": {
"output": "$.choices[0].message.content",
"output_files": "$.files"
},
"id": "ec_123",
"userId": "user_123",
"hasAuthToken": true,
"username": "<string>",
"hasPassword": true,
"headers": {
"Content-Type": "application/json"
},
"inputSchema": {
"type": "object",
"properties": {
"user_message": {
"type": "string",
"description": "The main user message to the agent"
},
"reasoning_level": {
"type": "string",
"enum": [
"low",
"medium",
"high"
],
"description": "How much reasoning the agent should apply"
},
"topic": {
"type": "string",
"enum": [
"billing",
"shipping",
"returns",
"account"
],
"description": "Conversation topic"
},
"customer_id": {
"type": "string",
"pattern": "^C-\\d{3,6}$",
"description": "Customer identifier"
}
},
"required": [
"user_message"
]
},
"type": "CONVERSATION",
"timeout": 15,
"rateLimit": 60,
"retryEnabled": true,
"retryMaxAttempts": 1,
"retryInitialDelayMs": 1000,
"retryBackoffStrategy": "EXPONENTIAL",
"retryMaxDelayMs": 3000,
"retryableStatusCodes": [
429,
500,
502,
503,
504
],
"acknowledgedInsecureHttp": false,
"conversationEndRules": [],
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.galtea.ai/endpointConnections"
payload = {
"productId": "prod_123",
"name": "My API Connection",
"url": "https://api.example.com/v1/chat/completions",
"httpMethod": "POST",
"authType": "BEARER",
"inputTemplate": "{\"prompt\": \"{{ input.user_message }}\"}",
"outputMapping": {
"output": "$.choices[0].message.content",
"output_files": "$.files"
},
"id": "ec_123",
"userId": "user_123",
"hasAuthToken": True,
"username": "<string>",
"hasPassword": True,
"headers": { "Content-Type": "application/json" },
"inputSchema": {
"type": "object",
"properties": {
"user_message": {
"type": "string",
"description": "The main user message to the agent"
},
"reasoning_level": {
"type": "string",
"enum": ["low", "medium", "high"],
"description": "How much reasoning the agent should apply"
},
"topic": {
"type": "string",
"enum": ["billing", "shipping", "returns", "account"],
"description": "Conversation topic"
},
"customer_id": {
"type": "string",
"pattern": "^C-\d{3,6}$",
"description": "Customer identifier"
}
},
"required": ["user_message"]
},
"type": "CONVERSATION",
"timeout": 15,
"rateLimit": 60,
"retryEnabled": True,
"retryMaxAttempts": 1,
"retryInitialDelayMs": 1000,
"retryBackoffStrategy": "EXPONENTIAL",
"retryMaxDelayMs": 3000,
"retryableStatusCodes": [429, 500, 502, 503, 504],
"acknowledgedInsecureHttp": False,
"conversationEndRules": [],
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
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({
productId: 'prod_123',
name: 'My API Connection',
url: 'https://api.example.com/v1/chat/completions',
httpMethod: 'POST',
authType: 'BEARER',
inputTemplate: '{"prompt": "{{ input.user_message }}"}',
outputMapping: {output: '$.choices[0].message.content', output_files: '$.files'},
id: 'ec_123',
userId: 'user_123',
hasAuthToken: true,
username: '<string>',
hasPassword: true,
headers: {'Content-Type': 'application/json'},
inputSchema: {
type: 'object',
properties: {
user_message: {type: 'string', description: 'The main user message to the agent'},
reasoning_level: {
type: 'string',
enum: ['low', 'medium', 'high'],
description: 'How much reasoning the agent should apply'
},
topic: {
type: 'string',
enum: ['billing', 'shipping', 'returns', 'account'],
description: 'Conversation topic'
},
customer_id: {type: 'string', pattern: '^C-\d{3,6}$', description: 'Customer identifier'}
},
required: ['user_message']
},
type: 'CONVERSATION',
timeout: 15,
rateLimit: 60,
retryEnabled: true,
retryMaxAttempts: 1,
retryInitialDelayMs: 1000,
retryBackoffStrategy: 'EXPONENTIAL',
retryMaxDelayMs: 3000,
retryableStatusCodes: [429, 500, 502, 503, 504],
acknowledgedInsecureHttp: false,
conversationEndRules: [],
createdAt: '2023-11-07T05:31:56Z',
deletedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.galtea.ai/endpointConnections', 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/endpointConnections",
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([
'productId' => 'prod_123',
'name' => 'My API Connection',
'url' => 'https://api.example.com/v1/chat/completions',
'httpMethod' => 'POST',
'authType' => 'BEARER',
'inputTemplate' => '{"prompt": "{{ input.user_message }}"}',
'outputMapping' => [
'output' => '$.choices[0].message.content',
'output_files' => '$.files'
],
'id' => 'ec_123',
'userId' => 'user_123',
'hasAuthToken' => true,
'username' => '<string>',
'hasPassword' => true,
'headers' => [
'Content-Type' => 'application/json'
],
'inputSchema' => [
'type' => 'object',
'properties' => [
'user_message' => [
'type' => 'string',
'description' => 'The main user message to the agent'
],
'reasoning_level' => [
'type' => 'string',
'enum' => [
'low',
'medium',
'high'
],
'description' => 'How much reasoning the agent should apply'
],
'topic' => [
'type' => 'string',
'enum' => [
'billing',
'shipping',
'returns',
'account'
],
'description' => 'Conversation topic'
],
'customer_id' => [
'type' => 'string',
'pattern' => '^C-\\d{3,6}$',
'description' => 'Customer identifier'
]
],
'required' => [
'user_message'
]
],
'type' => 'CONVERSATION',
'timeout' => 15,
'rateLimit' => 60,
'retryEnabled' => true,
'retryMaxAttempts' => 1,
'retryInitialDelayMs' => 1000,
'retryBackoffStrategy' => 'EXPONENTIAL',
'retryMaxDelayMs' => 3000,
'retryableStatusCodes' => [
429,
500,
502,
503,
504
],
'acknowledgedInsecureHttp' => false,
'conversationEndRules' => [
],
'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/endpointConnections"
payload := strings.NewReader("{\n \"productId\": \"prod_123\",\n \"name\": \"My API Connection\",\n \"url\": \"https://api.example.com/v1/chat/completions\",\n \"httpMethod\": \"POST\",\n \"authType\": \"BEARER\",\n \"inputTemplate\": \"{\\\"prompt\\\": \\\"{{ input.user_message }}\\\"}\",\n \"outputMapping\": {\n \"output\": \"$.choices[0].message.content\",\n \"output_files\": \"$.files\"\n },\n \"id\": \"ec_123\",\n \"userId\": \"user_123\",\n \"hasAuthToken\": true,\n \"username\": \"<string>\",\n \"hasPassword\": true,\n \"headers\": {\n \"Content-Type\": \"application/json\"\n },\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user_message\": {\n \"type\": \"string\",\n \"description\": \"The main user message to the agent\"\n },\n \"reasoning_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"low\",\n \"medium\",\n \"high\"\n ],\n \"description\": \"How much reasoning the agent should apply\"\n },\n \"topic\": {\n \"type\": \"string\",\n \"enum\": [\n \"billing\",\n \"shipping\",\n \"returns\",\n \"account\"\n ],\n \"description\": \"Conversation topic\"\n },\n \"customer_id\": {\n \"type\": \"string\",\n \"pattern\": \"^C-\\\\d{3,6}$\",\n \"description\": \"Customer identifier\"\n }\n },\n \"required\": [\n \"user_message\"\n ]\n },\n \"type\": \"CONVERSATION\",\n \"timeout\": 15,\n \"rateLimit\": 60,\n \"retryEnabled\": true,\n \"retryMaxAttempts\": 1,\n \"retryInitialDelayMs\": 1000,\n \"retryBackoffStrategy\": \"EXPONENTIAL\",\n \"retryMaxDelayMs\": 3000,\n \"retryableStatusCodes\": [\n 429,\n 500,\n 502,\n 503,\n 504\n ],\n \"acknowledgedInsecureHttp\": false,\n \"conversationEndRules\": [],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\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/endpointConnections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"prod_123\",\n \"name\": \"My API Connection\",\n \"url\": \"https://api.example.com/v1/chat/completions\",\n \"httpMethod\": \"POST\",\n \"authType\": \"BEARER\",\n \"inputTemplate\": \"{\\\"prompt\\\": \\\"{{ input.user_message }}\\\"}\",\n \"outputMapping\": {\n \"output\": \"$.choices[0].message.content\",\n \"output_files\": \"$.files\"\n },\n \"id\": \"ec_123\",\n \"userId\": \"user_123\",\n \"hasAuthToken\": true,\n \"username\": \"<string>\",\n \"hasPassword\": true,\n \"headers\": {\n \"Content-Type\": \"application/json\"\n },\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user_message\": {\n \"type\": \"string\",\n \"description\": \"The main user message to the agent\"\n },\n \"reasoning_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"low\",\n \"medium\",\n \"high\"\n ],\n \"description\": \"How much reasoning the agent should apply\"\n },\n \"topic\": {\n \"type\": \"string\",\n \"enum\": [\n \"billing\",\n \"shipping\",\n \"returns\",\n \"account\"\n ],\n \"description\": \"Conversation topic\"\n },\n \"customer_id\": {\n \"type\": \"string\",\n \"pattern\": \"^C-\\\\d{3,6}$\",\n \"description\": \"Customer identifier\"\n }\n },\n \"required\": [\n \"user_message\"\n ]\n },\n \"type\": \"CONVERSATION\",\n \"timeout\": 15,\n \"rateLimit\": 60,\n \"retryEnabled\": true,\n \"retryMaxAttempts\": 1,\n \"retryInitialDelayMs\": 1000,\n \"retryBackoffStrategy\": \"EXPONENTIAL\",\n \"retryMaxDelayMs\": 3000,\n \"retryableStatusCodes\": [\n 429,\n 500,\n 502,\n 503,\n 504\n ],\n \"acknowledgedInsecureHttp\": false,\n \"conversationEndRules\": [],\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/endpointConnections")
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 \"productId\": \"prod_123\",\n \"name\": \"My API Connection\",\n \"url\": \"https://api.example.com/v1/chat/completions\",\n \"httpMethod\": \"POST\",\n \"authType\": \"BEARER\",\n \"inputTemplate\": \"{\\\"prompt\\\": \\\"{{ input.user_message }}\\\"}\",\n \"outputMapping\": {\n \"output\": \"$.choices[0].message.content\",\n \"output_files\": \"$.files\"\n },\n \"id\": \"ec_123\",\n \"userId\": \"user_123\",\n \"hasAuthToken\": true,\n \"username\": \"<string>\",\n \"hasPassword\": true,\n \"headers\": {\n \"Content-Type\": \"application/json\"\n },\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"user_message\": {\n \"type\": \"string\",\n \"description\": \"The main user message to the agent\"\n },\n \"reasoning_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"low\",\n \"medium\",\n \"high\"\n ],\n \"description\": \"How much reasoning the agent should apply\"\n },\n \"topic\": {\n \"type\": \"string\",\n \"enum\": [\n \"billing\",\n \"shipping\",\n \"returns\",\n \"account\"\n ],\n \"description\": \"Conversation topic\"\n },\n \"customer_id\": {\n \"type\": \"string\",\n \"pattern\": \"^C-\\\\d{3,6}$\",\n \"description\": \"Customer identifier\"\n }\n },\n \"required\": [\n \"user_message\"\n ]\n },\n \"type\": \"CONVERSATION\",\n \"timeout\": 15,\n \"rateLimit\": 60,\n \"retryEnabled\": true,\n \"retryMaxAttempts\": 1,\n \"retryInitialDelayMs\": 1000,\n \"retryBackoffStrategy\": \"EXPONENTIAL\",\n \"retryMaxDelayMs\": 3000,\n \"retryableStatusCodes\": [\n 429,\n 500,\n 502,\n 503,\n 504\n ],\n \"acknowledgedInsecureHttp\": false,\n \"conversationEndRules\": [],\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"productId": "prod_123",
"name": "My API Connection",
"url": "https://api.example.com/v1/chat/completions",
"httpMethod": "POST",
"authType": "BEARER",
"inputTemplate": "{\"prompt\": \"{{ input.user_message }}\"}",
"outputMapping": {
"output": "$.choices[0].message.content",
"output_files": "$.files"
},
"id": "ec_123",
"userId": "user_123",
"hasAuthToken": true,
"username": "<string>",
"hasPassword": true,
"headers": {
"Content-Type": "application/json"
},
"inputSchema": {
"type": "object",
"properties": {
"user_message": {
"type": "string",
"description": "The main user message to the agent"
},
"reasoning_level": {
"type": "string",
"enum": [
"low",
"medium",
"high"
],
"description": "How much reasoning the agent should apply"
},
"topic": {
"type": "string",
"enum": [
"billing",
"shipping",
"returns",
"account"
],
"description": "Conversation topic"
},
"customer_id": {
"type": "string",
"pattern": "^C-\\d{3,6}$",
"description": "Customer identifier"
}
},
"required": [
"user_message"
]
},
"type": "CONVERSATION",
"timeout": 15,
"rateLimit": 60,
"retryEnabled": true,
"retryMaxAttempts": 1,
"retryInitialDelayMs": 1000,
"retryBackoffStrategy": "EXPONENTIAL",
"retryMaxDelayMs": 3000,
"retryableStatusCodes": [
429,
500,
502,
503,
504
],
"acknowledgedInsecureHttp": false,
"conversationEndRules": [],
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"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
"prod_123"
"My API Connection"
"https://api.example.com/v1/chat/completions"
GET, POST, PUT, PATCH, DELETE "POST"
NONE, BEARER, API_KEY, BASIC "BEARER"
Jinja2/Nunjucks template for request body. Must contain {{ input.user_message }} placeholder.
"{\"prompt\": \"{{ input.user_message }}\"}"
JSONPath expressions to extract values from API response. Must include "output" key. Special keys: "retrieval_context", "session_id" (initialization), "traces", and "output_files". "output_files" matches one file or a list of files the endpoint answers with, each a data: URI, an http(s) URL, the storage URI of a Galtea file, or an object with "base64", "url" or "uri" plus optional "mime_type" and "filename". Each file is stored as a Galtea file on the turn output: at most 20 files and 20 MB per output, a type a judge can read (the file extension decides it), and a URL is downloaded once without the connection headers or credentials, over plain http only when the connection acknowledged it. A Galtea file is linked rather than copied, and must be an uploaded file of the product organization. A file that cannot be stored fails the turn. Every other key is stored on the session metadata.
Show child attributes
Show child attributes
{ "output": "$.choices[0].message.content", "output_files": "$.files" }
"ec_123"
"user_123"
Whether an auth token is configured (token value is not exposed)
Username for Basic auth
Whether a password is configured (password value is not exposed)
Custom headers as key-value pairs. A secret value is encrypted at rest once its headers are saved, and every read returns it as "••••••••". A value is secret unless its name is Content-Type, Accept, Accept-Language, Accept-Encoding, Cache-Control, User-Agent, traceparent or tracestate, or it holds only placeholders (for example "Bearer {{ bearer_token }}"). On update, send "••••••••" to keep the stored value of that header name; any other value replaces it. Sending "••••••••" for a header with no stored value is a 400, and so is a value in the stored ciphertext shape or with a character a header cannot carry.
Show child attributes
Show child attributes
{ "Content-Type": "application/json" }
Optional JSON Schema (draft 2020-12) defining the structure of input fields, their types, and valid values. Must have type "object" with a "properties" key.
{ "type": "object", "properties": { "user_message": { "type": "string", "description": "The main user message to the agent" }, "reasoning_level": { "type": "string", "enum": ["low", "medium", "high"], "description": "How much reasoning the agent should apply" }, "topic": { "type": "string", "enum": ["billing", "shipping", "returns", "account"], "description": "Conversation topic" }, "customer_id": { "type": "string", "pattern": "^C-\\d{3,6}$", "description": "Customer identifier" } }, "required": ["user_message"] }
INITIALIZATION, CONVERSATION, FINALIZATION "CONVERSATION"
Per-attempt request timeout in seconds. Unset applies the default (15). Capped server-side at 120 seconds.
1 <= x <= 12015
Maximum requests per minute. Unset (null) means no rate limit.
x >= 160
Whether automatic retry is enabled for failed requests
Maximum number of retry attempts (applied when retryEnabled is true). 0 is only valid when retryEnabled is false; with retry enabled the minimum is 1.
0 <= x <= 10Initial delay in milliseconds before first retry
x >= 0Strategy for increasing delay between retries
FIXED, EXPONENTIAL, LINEAR Maximum delay between retry attempts, in milliseconds. Capped server-side at 60000 (60 seconds) to bound retry blast radius.
0 <= x <= 60000HTTP status codes that should trigger a retry
100 <= x <= 599Required true to use an http:// URL. It records that the creator accepted that traffic to this endpoint is not encrypted, so anyone on the network path can read prompts, responses and credentials. The acceptance covers the connection, not one host: a redirect may send an acknowledged request to any public http:// host, carrying the connection credentials with it. Without it every hop the platform makes to the endpoint must stay on https. It is stored as false for an https:// URL, whatever the request sends.
Responses that mean the agent closed the conversation on its own. Only a CONVERSATION connection accepts rules. A rule matches a response with its status code and, when bodyMatch is set, a response body whose first JSONPath match equals the expected value as text. The rules are checked before the retry policy, and a matching response is never retried, even when its status code is in retryableStatusCodes. A matching 2xx response with an agent output keeps its turn as the last one, on any turn and in a single-turn test. A matching response with no agent output (a non-2xx response, or a 2xx response with no output) removes the rejected turn on a later turn of a scenario test. In both cases the session completes with the turns so far and is evaluated, with the stopping reason "The agent ended the conversation (HTTP )". A match with no agent output on the first turn, or on a single-turn test, still fails the session. An empty list keeps the default behaviour.
20Show child attributes
Show child attributes
Response
Endpoint connection created successfully
"prod_123"
"My API Connection"
"https://api.example.com/v1/chat/completions"
GET, POST, PUT, PATCH, DELETE "POST"
NONE, BEARER, API_KEY, BASIC "BEARER"
Jinja2/Nunjucks template for request body. Must contain {{ input.user_message }} placeholder.
"{\"prompt\": \"{{ input.user_message }}\"}"
JSONPath expressions to extract values from API response. Must include "output" key. Special keys: "retrieval_context", "session_id" (initialization), "traces", and "output_files". "output_files" matches one file or a list of files the endpoint answers with, each a data: URI, an http(s) URL, the storage URI of a Galtea file, or an object with "base64", "url" or "uri" plus optional "mime_type" and "filename". Each file is stored as a Galtea file on the turn output: at most 20 files and 20 MB per output, a type a judge can read (the file extension decides it), and a URL is downloaded once without the connection headers or credentials, over plain http only when the connection acknowledged it. A Galtea file is linked rather than copied, and must be an uploaded file of the product organization. A file that cannot be stored fails the turn. Every other key is stored on the session metadata.
Show child attributes
Show child attributes
{ "output": "$.choices[0].message.content", "output_files": "$.files" }
"ec_123"
"user_123"
Whether an auth token is configured (token value is not exposed)
Username for Basic auth
Whether a password is configured (password value is not exposed)
Custom headers as key-value pairs. A secret value is encrypted at rest once its headers are saved, and every read returns it as "••••••••". A value is secret unless its name is Content-Type, Accept, Accept-Language, Accept-Encoding, Cache-Control, User-Agent, traceparent or tracestate, or it holds only placeholders (for example "Bearer {{ bearer_token }}"). On update, send "••••••••" to keep the stored value of that header name; any other value replaces it. Sending "••••••••" for a header with no stored value is a 400, and so is a value in the stored ciphertext shape or with a character a header cannot carry.
Show child attributes
Show child attributes
{ "Content-Type": "application/json" }
Optional JSON Schema (draft 2020-12) defining the structure of input fields, their types, and valid values. Must have type "object" with a "properties" key.
{ "type": "object", "properties": { "user_message": { "type": "string", "description": "The main user message to the agent" }, "reasoning_level": { "type": "string", "enum": ["low", "medium", "high"], "description": "How much reasoning the agent should apply" }, "topic": { "type": "string", "enum": ["billing", "shipping", "returns", "account"], "description": "Conversation topic" }, "customer_id": { "type": "string", "pattern": "^C-\\d{3,6}$", "description": "Customer identifier" } }, "required": ["user_message"] }
INITIALIZATION, CONVERSATION, FINALIZATION "CONVERSATION"
Per-attempt request timeout in seconds. Unset applies the default (15). Capped server-side at 120 seconds.
1 <= x <= 12015
Maximum requests per minute. Unset (null) means no rate limit.
x >= 160
Whether automatic retry is enabled for failed requests
Maximum number of retry attempts (applied when retryEnabled is true). 0 is only valid when retryEnabled is false; with retry enabled the minimum is 1.
0 <= x <= 10Initial delay in milliseconds before first retry
x >= 0Strategy for increasing delay between retries
FIXED, EXPONENTIAL, LINEAR Maximum delay between retry attempts, in milliseconds. Capped server-side at 60000 (60 seconds) to bound retry blast radius.
0 <= x <= 60000HTTP status codes that should trigger a retry
100 <= x <= 599Required true to use an http:// URL. It records that the creator accepted that traffic to this endpoint is not encrypted, so anyone on the network path can read prompts, responses and credentials. The acceptance covers the connection, not one host: a redirect may send an acknowledged request to any public http:// host, carrying the connection credentials with it. Without it every hop the platform makes to the endpoint must stay on https. It is stored as false for an https:// URL, whatever the request sends.
Responses that mean the agent closed the conversation on its own. Only a CONVERSATION connection accepts rules. A rule matches a response with its status code and, when bodyMatch is set, a response body whose first JSONPath match equals the expected value as text. The rules are checked before the retry policy, and a matching response is never retried, even when its status code is in retryableStatusCodes. A matching 2xx response with an agent output keeps its turn as the last one, on any turn and in a single-turn test. A matching response with no agent output (a non-2xx response, or a 2xx response with no output) removes the rejected turn on a later turn of a scenario test. In both cases the session completes with the turns so far and is evaluated, with the stopping reason "The agent ended the conversation (HTTP )". A match with no agent output on the first turn, or on a single-turn test, still fails the session. An empty list keeps the default behaviour.
20Show child attributes
Show child attributes