> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](https://docs.galtea.ai/concepts/product/endpoint-connection).




## OpenAPI

````yaml https://api.galtea.ai/openapi.json post /endpointConnections/parse-curl
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /endpointConnections/parse-curl:
    post:
      tags:
        - endpoint-connections
      summary: Parse a cURL command into endpoint connection fields
      description: >
        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](https://docs.galtea.ai/concepts/product/endpoint-connection).
      operationId: parseCurlEndpointConnection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - curl
              properties:
                curl:
                  type: string
                  description: 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:
                  type: string
                  enum:
                    - INITIALIZATION
                    - CONVERSATION
                    - FINALIZATION
                  description: >
                    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).
                  example: CONVERSATION
                productName:
                  type: string
                  description: >
                    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
      responses:
        '200':
          description: >-
            Parsed endpoint connection fields (best effort) with any structured
            parse errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParseCurlEndpointConnectionResult'
        '400':
          description: Missing or empty cURL command
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    ParseCurlEndpointConnectionResult:
      type: object
      required:
        - parsed
        - errors
      description: >-
        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.
      properties:
        parsed:
          type: object
          properties:
            url:
              type: string
              nullable: true
              example: https://api.example.com/v1/chat
            httpMethod:
              type: string
              nullable: true
              enum:
                - GET
                - POST
                - PUT
                - PATCH
                - DELETE
              example: POST
            headers:
              type: object
              nullable: true
              additionalProperties:
                type: string
              example:
                Content-Type: application/json
            authType:
              type: string
              nullable: true
              enum:
                - NONE
                - BEARER
                - API_KEY
                - BASIC
              example: BEARER
            authToken:
              type: string
              nullable: true
              description: >-
                Bearer token or API key extracted from the command (when
                present).
            username:
              type: string
              nullable: true
              description: Basic-auth username (when present).
            password:
              type: string
              nullable: true
              description: Basic-auth password (when present).
            body:
              type: string
              nullable: true
              description: Raw request body, verbatim (when present).
            inputTemplate:
              type: string
              nullable: true
              description: >-
                Best-effort Jinja2 input template derived from a JSON body. Null
                when the body is absent or not JSON.
              example: >-
                {"messages":[{"role":"user","content":"{{ input.user_message
                }}"}]}
            inputTemplateGeneratedByAi:
              type: boolean
              description: >-
                True when `inputTemplate` was produced by the LLM enrichment
                pass (placing the full placeholder vocabulary) rather than the
                deterministic single-leaf heuristic. Lets the caller badge the
                field as AI-generated vs auto-filled.
              example: true
            name:
              type: string
              nullable: true
              description: >-
                Suggested connection name. A deterministic host-based default
                (`{host} {Type} Connection`) for every type, upgraded by the LLM
                enrichment pass for CONVERSATION using the URL and the optional
                `productName`.
              example: Acme Support — OpenAI Chat
            nameGeneratedByAi:
              type: boolean
              description: >-
                True when `name` was produced by the LLM enrichment pass rather
                than the deterministic host-based floor. Lets the caller badge
                the field as AI-generated vs auto-filled.
              example: true
        errors:
          type: array
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                enum:
                  - NOT_CURL
                  - NO_URL
                  - UNTERMINATED_QUOTE
                  - BODY_NOT_JSON
                  - DANGLING_FLAG
                example: BODY_NOT_JSON
              message:
                type: string
                example: >-
                  The request body is not valid JSON, so no input template could
                  be derived. The raw body was kept.
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        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-...`.

````