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

# Test endpoint connection

> Test an endpoint connection by making a sample request. Can be used in two modes: (1) Without an ID — all connection fields are required (creation flow). (2) With an ID — fetches the stored connection and applies any provided fields as overrides (update flow). The two credential fields are the exception: a blank `authToken` or `password` keeps the stored one, and changing `authType` drops the credentials the new type does not use, exactly as saving would. With an ID, the test needs permission to update the connection, whatever the `url`. While the connection holds a stored secret, a `url` of another origin (scheme, host or port) is a 400 and nothing is sent, and so is a template tag in the host. The stored URL, or another path on its origin, still works. A stored URL with a template tag in its host has no known origin, so only the identical URL passes. Without an ID, it needs permission to create one. See [Endpoint Connections](https://docs.galtea.ai/concepts/product/endpoint-connection).


> [!WARNING]
>
> You are reading the docs of Galtea 5.17. [Read this page in the latest version](https://docs.galtea.ai/api-reference/endpoint-connections/test-endpoint-connection.md).


## OpenAPI

````yaml /v5.17/openapi.json post /endpointConnections/testConnection
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/testConnection:
    post:
      tags:
        - endpoint-connections
      summary: Test endpoint connection
      description: >
        Test an endpoint connection by making a sample request. Can be used in
        two modes: (1) Without an ID — all connection fields are required
        (creation flow). (2) With an ID — fetches the stored connection and
        applies any provided fields as overrides (update flow). The two
        credential fields are the exception: a blank `authToken` or `password`
        keeps the stored one, and changing `authType` drops the credentials the
        new type does not use, exactly as saving would. With an ID, the test
        needs permission to update the connection, whatever the `url`. While the
        connection holds a stored secret, a `url` of another origin (scheme,
        host or port) is a 400 and nothing is sent, and so is a template tag in
        the host. The stored URL, or another path on its origin, still works. A
        stored URL with a template tag in its host has no known origin, so only
        the identical URL passes. Without an ID, it needs permission to create
        one. See [Endpoint
        Connections](https://docs.galtea.ai/concepts/product/endpoint-connection).
      operationId: testEndpointConnection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: >-
                    Optional ID of an existing endpoint connection. When
                    provided, stored connection data is used as base and
                    remaining fields act as overrides.
                  example: id_123
                url:
                  type: string
                  description: The endpoint URL to test.
                  example: https://api.example.com
                httpMethod:
                  type: string
                  description: HTTP method (GET, POST, etc.)
                authType:
                  type: string
                  description: Authentication type (NONE, BEARER, API_KEY, BASIC)
                authToken:
                  type: string
                  description: >-
                    Authentication token (for BEARER or API_KEY). With an ID, a
                    blank value (null or empty string) keeps the stored token,
                    and the token is dropped when authType changes to NONE or
                    BASIC.
                username:
                  type: string
                  description: Username (for BASIC auth)
                password:
                  type: string
                  description: >-
                    Password (for BASIC auth). With an ID, a blank value (null
                    or empty string) keeps the stored password, and the password
                    is dropped when authType changes to NONE, BEARER or API_KEY.
                  example: securePass123!
                headers:
                  type: object
                  description: >-
                    Custom headers as key-value pairs. With an ID, a value of
                    "••••••••" (the masked value a read returns) sends the
                    stored value of that header name. Without an ID, or for a
                    header with no stored value, "••••••••" is a 400. A value in
                    the stored ciphertext shape is a 400.
                inputTemplate:
                  type: string
                  description: Input template with Jinja2 placeholders
                timeout:
                  type: number
                  description: Request timeout in seconds
                acknowledgedInsecureHttp:
                  type: boolean
                  description: >-
                    Required true to test an http:// URL. With an ID, the stored
                    value applies when omitted. It is ignored for an https://
                    URL.
                outputMapping:
                  type: object
                  additionalProperties:
                    type: string
                  description: >-
                    JSONPath expressions applied to a successful response. The
                    result is returned in `extractedOutput`. It is not read from
                    the stored connection.
      responses:
        '200':
          description: Test connection result
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - statusCode
                  - latency
                properties:
                  success:
                    type: boolean
                  statusCode:
                    type: integer
                  latency:
                    type: number
                  response:
                    type: object
                    description: >-
                      The endpoint response. Each inline file payload that
                      `output_files` matched is replaced by a placeholder such
                      as `<base64, 1.2 MB>`. The bytes of a file a run would
                      store are in `extractedOutput.output_files`. A refused
                      payload is not echoed.
                  error:
                    type: string
                  extractedOutput:
                    type: object
                    description: >-
                      The output mapping applied to a successful response.
                      Absent when no mapping was sent.
                    properties:
                      output:
                        type: string
                      retrieval_context:
                        type: string
                        nullable: true
                      session_id:
                        type: string
                        nullable: true
                      traces:
                        type: array
                        nullable: true
                        items:
                          type: object
                      metadata:
                        type: object
                        description: Values of the mapping keys that are not special keys.
                      output_files:
                        type: array
                        nullable: true
                        description: >-
                          The files `output_files` matched, as a run would store
                          them. Nothing is downloaded or stored by the test.
                          Null when the mapping has no `output_files` key, and
                          empty when it matched no file.
                        items:
                          type: object
                          properties:
                            position:
                              type: integer
                              description: 1-based order of the file in the response.
                            kind:
                              type: string
                              enum:
                                - base64
                                - data_uri
                                - url
                                - galtea_file
                              description: >-
                                How the endpoint sent the file. `galtea_file` is
                                a file already in Galtea storage, which a run
                                links rather than copies.
                            filename:
                              type: string
                              nullable: true
                              description: The name the file would be stored under.
                            mime_type:
                              type: string
                              nullable: true
                              description: >-
                                The type the file would be stored as, decided by
                                its extension. Null when the type is not
                                allowed, or for a URL with no extension until a
                                run downloads it.
                            size_bytes:
                              type: integer
                              nullable: true
                              description: >-
                                The decoded size of an inline file. Null for a
                                URL or a Galtea file.
                            host:
                              type: string
                              nullable: true
                              description: The host of a URL file. Null for any other file.
                            base64:
                              type: string
                              nullable: true
                              description: >-
                                The bytes of an inline file, for a preview. Null
                                for any other file.
                            uri:
                              type: string
                              nullable: true
                              description: >-
                                The storage URI of a Galtea file, as the
                                endpoint sent it, for a preview through the
                                storage routes. Null for any other file.
                      output_file_refusals:
                        type: array
                        nullable: true
                        description: >-
                          Why a file would fail the turn, as far as the test can
                          tell without a download or a storage read. A Galtea
                          file of another organization is refused here; a
                          missing one only when a run reads it. Null when the
                          mapping has no `output_files` key.
                        items:
                          type: object
                          properties:
                            position:
                              type: integer
                            message:
                              type: string
                  extractionError:
                    type: string
                    description: Why the output mapping could not be applied.
        '400':
          description: >-
            Invalid request: a malformed or unrenderable field, a scheme the
            deployment does not allow, a URL whose host is a blocked address,
            or, with an ID and a stored secret, a URL of another origin or a
            template tag in the host. The endpoint was never contacted, so this
            is not reported as an unsuccessful test.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            With an ID, the caller may not update the connection. Without an ID,
            the caller may not create one. The endpoint was never contacted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Endpoint connection not found (when id is provided)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    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-...`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.