After creating a connection, the CLI should automatically call the health check endpoint to validate credentials.
Currently, creating a connection only persists it (so it gets a stable ID for troubleshooting), which means invalid credentials aren't caught until the user manually calls the health check API. The CLI should layer the health check on top of that flow to give users immediate feedback.
Expected behavior:
- After a successful
create connection, automatically call the health check endpoint.
- If the health check passes, report success as normal.
- If the health check fails, surface the error clearly and walk the user through updating the connection (e.g. prompt to fix credentials/config, re-create with corrected values), then re-run discover since it would have failed with the bad connection.
Relevant API calls:
- Create connection —
POST /v1/connections
{
"name": "my-postgres",
"source_type": "postgres",
"config": { "host": "...", "port": 5432, "database": "..." },
"secret_name": "my-pg-secret" // or "secret_id": "secr_abc123"
}
Response (201):
{
"id": "conn_abc123",
"name": "my-postgres",
"source_type": "postgres",
"tables_discovered": 12,
"discovery_status": "success",
"discovery_error": null
}
- Health check —
GET /v1/connections/{connection_id}/health
Response (200):
{
"connection_id": "conn_abc123",
"healthy": true,
"latency_ms": 42,
"error": null
}
On failure, healthy is false and error contains the reason.
- Re-run discovery (after fixing credentials) —
POST /v1/refresh
{
"connection_id": "conn_abc123"
}
Note: there is (currently) no update-connection endpoint. If credentials are wrong, the user would need to update the underlying secret (via PUT /v1/secrets/{name}) or delete and re-create the connection.
After creating a connection, the CLI should automatically call the health check endpoint to validate credentials.
Currently, creating a connection only persists it (so it gets a stable ID for troubleshooting), which means invalid credentials aren't caught until the user manually calls the health check API. The CLI should layer the health check on top of that flow to give users immediate feedback.
Expected behavior:
create connection, automatically call the health check endpoint.Relevant API calls:
POST /v1/connections{ "name": "my-postgres", "source_type": "postgres", "config": { "host": "...", "port": 5432, "database": "..." }, "secret_name": "my-pg-secret" // or "secret_id": "secr_abc123" }Response (
201):{ "id": "conn_abc123", "name": "my-postgres", "source_type": "postgres", "tables_discovered": 12, "discovery_status": "success", "discovery_error": null }GET /v1/connections/{connection_id}/healthResponse (
200):{ "connection_id": "conn_abc123", "healthy": true, "latency_ms": 42, "error": null }On failure,
healthyisfalseanderrorcontains the reason.POST /v1/refresh{ "connection_id": "conn_abc123" }Note: there is (currently) no update-connection endpoint. If credentials are wrong, the user would need to update the underlying secret (via
PUT /v1/secrets/{name}) or delete and re-create the connection.