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

# Test a saved connection

> Verify a saved connection's stored credentials. Admin only. Always returns HTTP 200 with a TestResult for every handler outcome; only an unknown connection id returns 404. On success, `last_verified` is refreshed.



## OpenAPI

````yaml /openapi.json post /connections/{connection_id}/test
openapi: 3.1.0
info:
  title: GetDialed Flows API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/flows
    description: Production
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /connections/{connection_id}/test:
    post:
      tags:
        - connections
      summary: Test a saved connection
      description: >-
        Verify a saved connection's stored credentials. Admin only. Always
        returns HTTP 200 with a TestResult for every handler outcome; only an
        unknown connection id returns 404. On success, `last_verified` is
        refreshed.
      operationId: test_saved_connection_connections__connection_id__test_post
      parameters:
        - name: connection_id
          in: path
          required: true
          schema:
            type: string
            title: Connection Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestResult'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              example:
                detail: Authentication required
        '403':
          description: Caller is authenticated but not an admin
          content:
            application/json:
              example:
                detail: Admin role required
        '404':
          description: >-
            No such connection for this organization (cross-tenant access also
            returns 404)
          content:
            application/json:
              example:
                detail: Connection not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded — retry after the Retry-After header
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
          content:
            application/json:
              example:
                detail: 'Rate limit exceeded: 100 per 1 minute'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    TestResult:
      properties:
        success:
          type: boolean
          title: Success
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        details:
          type: string
          title: Details
        latency_ms:
          type: integer
          title: Latency Ms
        tested_at:
          type: string
          format: date-time
          title: Tested At
      type: object
      required:
        - success
        - error
        - details
        - latency_ms
        - tested_at
      title: TestResult
      description: >-
        Result of a connection test (D-08, 5 fields locked).


        Returned by both POST /connections/{conn_id}/test and POST
        /connections/test

        with HTTP 200 for ALL handler outcomes including timeouts (D-03). The UI

        always parses this exact shape regardless of failure mode.


        `error` is one of 7 codes (D-09) when success=False, or None when
        success=True:
          - AUTH_FAILED, NETWORK, TIMEOUT, RATE_LIMITED,
            PERMISSION_DENIED, INVALID_CREDENTIALS_SHAPE, UNKNOWN

        `error` is typed as `str | None` (not Literal[...]) per PATTERNS.md

        anti-pattern note: keeps schema evolution decoupled from handler logic.


        `latency_ms` is HANDLER-measured (start of network round-trip to end of

        response parsing); excludes API/serialization overhead.


        `tested_at` is set by the HANDLER at the start of the attempt, not by

        the router. (A4 binding in 38-RESEARCH.md.)
      example:
        details: Authenticated successfully; 3 lists visible
        latency_ms: 412
        success: true
        tested_at: '2026-07-09T18:00:00Z'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````