Skip to main content

Returns

Returns a TestConnectionResult object containing:
  • success (bool): Whether the test request succeeded.
  • status_code (int): The HTTP status code returned by the endpoint.
  • latency (float): Round-trip latency in milliseconds.
  • response (any): The raw response body from the endpoint.
  • error (string | None): Error message if the request failed.
  • extracted_output (dict | None): Values extracted via output_mapping, if provided.
  • extraction_error (string | None): Error message if extraction failed.

Modes

This method can be called in two ways: With an existing connection ID — the stored connection is used as a base and any provided fields act as overrides:
    test_result = galtea.endpoint_connections.test(
        id=endpoint_connection_id,
    )
Without an ID — all connection fields are provided directly (useful during creation flow):
    test_result = galtea.endpoint_connections.test(
        url="https://api.example.com/v1/chat",
        http_method="POST",
        auth_type="BEARER",
        auth_token="YOUR_AUTH_TOKEN",
        input_template='{"message": "{{ input }}"}',
        output_mapping={"output": "$.response"},
        type=EndpointConnectionType.CONVERSATION,
        timeout=30,
    )

Parameters

id
string
ID of an existing endpoint connection to test. When provided, stored connection data is used as the base and remaining fields act as overrides.
url
string
The endpoint URL to test. For multi-step session lifecycles, supports a {{ session_id }} placeholder (requires an INITIALIZATION endpoint).
http_method
string
HTTP method. Valid values: GET, POST, PUT, PATCH, DELETE.
input_template
string
Input template with Jinja2 placeholders. See Input Template.
auth_type
string
Authentication type. Valid values: NONE, BEARER, API_KEY, BASIC.
auth_token
string
Authentication token.
username
string
Username for BASIC authentication.
password
string
Password for BASIC authentication.
headers
dict[string, string]
Custom headers. Supports credential placeholders (e.g., {{ bearer_token }}, {{ api_key }}). See Custom Headers.
output_mapping
dict[string, string]
Output mapping using JSONPath expressions. See Output Mapping.
type
string
Endpoint connection type. Valid values: INITIALIZATION, CONVERSATION, FINALIZATION. CONVERSATION is required for all products. INITIALIZATION and FINALIZATION are only needed for complex session management.
timeout
int
Request timeout in seconds.
All fields except id default to PydanticUndefined (from pydantic_core). Omit a field (or pass PydanticUndefined) to exclude it from the test request. Pass None to explicitly send null — useful to override a stored value when testing with an existing connection ID. Pass a value to include it.