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

# Test a backend connection

> Validates connectivity and credentials against the provider's API with a lightweight, auth-only request. Test either a stored registry (registry_id) or an inline candidate configuration (provider + auth). Always returns 200; inspect "ok" and "stage" for the outcome.



## OpenAPI

````yaml /trustgate/api/openapi.json post /v1/gateways/{gateway_id}/registries/test-connection
openapi: 3.0.0
info:
  description: >-
    Administrative API for managing gateways and their registries, policies,
    consumers, roles and auth credentials.
  title: TrustGate Admin API
  contact:
    name: NeuralTrust
    url: https://neuraltrust.ai/contact
    email: support@neuraltrust.ai
  version: '1.0'
servers:
  - url: https://agentgateway-admin.dev.neuraltrust.ai
    description: Admin API
security: []
paths:
  /v1/gateways/{gateway_id}/registries/test-connection:
    post:
      tags:
        - registries
      summary: Test a backend connection
      description: >-
        Validates connectivity and credentials against the provider's API with a
        lightweight, auth-only request. Test either a stored registry
        (registry_id) or an inline candidate configuration (provider + auth).
        Always returns 200; inspect "ok" and "stage" for the outcome.
      parameters:
        - description: Gateway id
          name: gateway_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.TestConnectionRequest
        description: Connection to test
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_response.TestConnectionResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
      security:
        - BearerAuth: []
components:
  schemas:
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.TestConnectionRequest:
      type: object
      properties:
        auth:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.TargetAuthRequest
        provider:
          type: string
        provider_options:
          type: object
          additionalProperties: {}
        registry_id:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_response.TestConnectionResponse:
      type: object
      properties:
        latency_ms:
          type: integer
        message:
          type: string
        ok:
          type: boolean
        provider:
          type: string
        stage:
          type: string
        status_code:
          type: integer
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.TargetAuthRequest:
      type: object
      properties:
        api_key:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.APIKeyAuthRequest
        aws:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.AWSAuthRequest
        azure:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.AzureAuthRequest
        gcp_service_account:
          type: string
        oauth:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.TargetOAuthConfigRequest
        type:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.APIKeyAuthRequest:
      type: object
      properties:
        api_key:
          description: '#nosec G117'
          type: string
        header_name:
          type: string
        header_value:
          type: string
        param_location:
          type: string
        param_name:
          type: string
        param_value:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.AWSAuthRequest:
      type: object
      properties:
        access_key_id:
          type: string
        region:
          type: string
        role:
          type: string
        secret_access_key:
          description: '#nosec G117'
          type: string
        session_token:
          description: '#nosec G117'
          type: string
        use_role:
          type: boolean
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.AzureAuthRequest:
      type: object
      properties:
        api_key:
          description: '#nosec G117'
          type: string
        client_id:
          type: string
        client_secret:
          description: '#nosec G117'
          type: string
        endpoint:
          type: string
        tenant_id:
          type: string
        use_managed_identity:
          type: boolean
        version:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_registry_request.TargetOAuthConfigRequest:
      type: object
      properties:
        audience:
          type: string
        client_id:
          type: string
        client_secret:
          description: '#nosec G117'
          type: string
        code:
          type: string
        code_verifier:
          type: string
        extra:
          type: object
          additionalProperties:
            type: string
        grant_type:
          type: string
        password:
          description: '#nosec G117'
          type: string
        redirect_uri:
          type: string
        refresh_token:
          description: '#nosec G117'
          type: string
        scopes:
          type: array
          items:
            type: string
        token_url:
          type: string
        use_basic_auth:
          type: boolean
        username:
          type: string
  securitySchemes:
    BearerAuth:
      type: apiKey
      name: Authorization
      in: header

````