Test ad-hoc credentials
Verify a credentials dict without saving anything (the UI’s test-before-save flow). Admin only. Always returns HTTP 200 with a TestResult — the success/error fields carry the outcome, including timeouts.
Authorizations
Body
Ad-hoc credentials test request body (D-06).
Used by POST /connections/test (no saved connection required). The UI's "test before save" flow posts this body to verify credentials before calling POST /connections to persist them.
Differs from ConnectionCreate: no name, no credentials_ref,
no status. credentials is REQUIRED (not optional) — the whole
point is to test a specific credentials dict.
Response
Successful Response
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.)