Skip to main content
POST
/
endpointConnections
/
parse-curl
Parse a cURL command into endpoint connection fields
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"
}
EOF
{
  "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."
    }
  ]
}

Authorizations

Authorization
string
header
required

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

application/json
curl
string
required

The raw cURL command to parse.

Example:

"curl https://api.example.com/v1/chat -H 'Authorization: Bearer sk-123' -d '{\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}'"

connectionType
enum<string>

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).

Available options:
INITIALIZATION,
CONVERSATION,
FINALIZATION
Example:

"CONVERSATION"

productName
string

Optional product name, used only as naming signal for the suggested connection name in the response. Not persisted and never referenced by the input template. When omitted the name is derived from the URL.

Example:

"Acme Support"

Response

Parsed endpoint connection fields (best effort) with any structured parse errors.

Result of parsing a raw cURL command. parsed is best-effort and always present (even when errors is non-empty); errors lists structured reasons the command could not be fully parsed.

parsed
object
required
errors
object[]
required