Skip to content

Add test connection endpoint for warehouse connections (Snowflake) #7277

@gagantrivedi

Description

@gagantrivedi

Endpoint

POST /api/v1/organisations/{organisation_pk}/integrations/warehouse-connections/{id}/test/

Request body

{}

Empty — all config and the private key are already stored on the connection.

Response (200 OK) — success

{
  "success": true,
  "tested_at": "2026-04-17T10:05:00Z"
}

Response (200 OK) — failure

{
  "success": false,
  "tested_at": "2026-04-17T10:05:00Z",
  "error": "SQL access control error: Insufficient privileges to operate on warehouse 'COMPUTE_WH'"
}

What the server does

  1. Open a Snowflake session using the stored account_identifier, user, and decrypted private key.
  2. Run SELECT 1 against the configured warehouse / database / schema — implicitly validates auth + warehouse access + db/schema access in one call.
  3. Run LIST @<stage> — validates the stage exists and is reachable.

First error wins. Raw Snowflake error message is returned as error.

Side effects

Updates the connection row:

  • last_tested_at = now
  • statusconnected on success, error on failure
  • last_error = the error string (or null on success)

Notes

  • Always returns 200 when the test ran, regardless of outcome. Reserve 4xx/5xx for request-level problems (unauthorized, connection not found, server error).
  • Sync. Full probe is <5s.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions