curl --request POST \
--url https://api.galtea.ai/endpointConnections/parse-curl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"curl": "curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}'",
"connectionType": "CONVERSATION",
"productName": "Acme Support"
}
EOFimport requests
url = "https://api.galtea.ai/endpointConnections/parse-curl"
payload = {
"curl": "curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}'",
"connectionType": "CONVERSATION",
"productName": "Acme Support"
}
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({
curl: 'curl https://api.example.com/v1/chat -H \'Authorization: Bearer sk-123\' -d \'{"messages":[{"role":"user","content":"hi"}]}\'',
connectionType: 'CONVERSATION',
productName: 'Acme Support'
})
};
fetch('https://api.galtea.ai/endpointConnections/parse-curl', 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/parse-curl",
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([
'curl' => 'curl https://api.example.com/v1/chat -H \'Authorization: Bearer sk-123\' -d \'{"messages":[{"role":"user","content":"hi"}]}\'',
'connectionType' => 'CONVERSATION',
'productName' => 'Acme Support'
]),
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/parse-curl"
payload := strings.NewReader("{\n \"curl\": \"curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"hi\\\"}]}'\",\n \"connectionType\": \"CONVERSATION\",\n \"productName\": \"Acme Support\"\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/parse-curl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"curl\": \"curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"hi\\\"}]}'\",\n \"connectionType\": \"CONVERSATION\",\n \"productName\": \"Acme Support\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/endpointConnections/parse-curl")
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 \"curl\": \"curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"hi\\\"}]}'\",\n \"connectionType\": \"CONVERSATION\",\n \"productName\": \"Acme Support\"\n}"
response = http.request(request)
puts response.read_body{
"parsed": {
"url": "https://api.example.com/v1/chat",
"httpMethod": "POST",
"headers": {
"Content-Type": "application/json"
},
"authType": "BEARER",
"authToken": "<string>",
"username": "<string>",
"password": "<string>",
"body": "<string>",
"inputTemplate": "{\"messages\":[{\"role\":\"user\",\"content\":\"{{ input.user_message }}\"}]}",
"inputTemplateGeneratedByAi": true,
"name": "Acme Support — OpenAI Chat",
"nameGeneratedByAi": true
},
"errors": [
{
"code": "BODY_NOT_JSON",
"message": "The request body is not valid JSON, so no input template could be derived. The raw body was kept."
}
]
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Parse a cURL command into endpoint connection fields
Parse a raw cURL command into best-effort endpoint-connection fields (URL, HTTP method, headers, auth type/token, request body, and a derived input template). The parse is best-effort: a command that cannot be fully parsed still returns the partial entity together with a structured errors array describing what could not be parsed — nothing is discarded on partial failure. The parsed fields are NOT persisted; the caller applies them to a creation form. See Endpoint Connections.
curl --request POST \
--url https://api.galtea.ai/endpointConnections/parse-curl \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"curl": "curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}'",
"connectionType": "CONVERSATION",
"productName": "Acme Support"
}
EOFimport requests
url = "https://api.galtea.ai/endpointConnections/parse-curl"
payload = {
"curl": "curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}'",
"connectionType": "CONVERSATION",
"productName": "Acme Support"
}
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({
curl: 'curl https://api.example.com/v1/chat -H \'Authorization: Bearer sk-123\' -d \'{"messages":[{"role":"user","content":"hi"}]}\'',
connectionType: 'CONVERSATION',
productName: 'Acme Support'
})
};
fetch('https://api.galtea.ai/endpointConnections/parse-curl', 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/parse-curl",
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([
'curl' => 'curl https://api.example.com/v1/chat -H \'Authorization: Bearer sk-123\' -d \'{"messages":[{"role":"user","content":"hi"}]}\'',
'connectionType' => 'CONVERSATION',
'productName' => 'Acme Support'
]),
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/parse-curl"
payload := strings.NewReader("{\n \"curl\": \"curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"hi\\\"}]}'\",\n \"connectionType\": \"CONVERSATION\",\n \"productName\": \"Acme Support\"\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/parse-curl")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"curl\": \"curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"hi\\\"}]}'\",\n \"connectionType\": \"CONVERSATION\",\n \"productName\": \"Acme Support\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/endpointConnections/parse-curl")
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 \"curl\": \"curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\\\"messages\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"hi\\\"}]}'\",\n \"connectionType\": \"CONVERSATION\",\n \"productName\": \"Acme Support\"\n}"
response = http.request(request)
puts response.read_body{
"parsed": {
"url": "https://api.example.com/v1/chat",
"httpMethod": "POST",
"headers": {
"Content-Type": "application/json"
},
"authType": "BEARER",
"authToken": "<string>",
"username": "<string>",
"password": "<string>",
"body": "<string>",
"inputTemplate": "{\"messages\":[{\"role\":\"user\",\"content\":\"{{ input.user_message }}\"}]}",
"inputTemplateGeneratedByAi": true,
"name": "Acme Support — OpenAI Chat",
"nameGeneratedByAi": true
},
"errors": [
{
"code": "BODY_NOT_JSON",
"message": "The request body is not valid JSON, so no input template could be derived. The raw body was kept."
}
]
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
Body
Target endpoint-connection type. Optional; defaults to CONVERSATION. CONVERSATION runs an LLM pass to enrich the derived input template; INITIALIZATION and FINALIZATION seed the input template with the raw JSON body verbatim (no placeholder, no AI).
INITIALIZATION, CONVERSATION, FINALIZATION "CONVERSATION"
Response
Parsed endpoint connection fields (best effort) with any structured parse errors.