Skip to content

Add list and get endpoints for warehouse connections #7279

@gagantrivedi

Description

@gagantrivedi

Endpoints

List (primary — used by the dashboard on page load to check if a connection exists):

GET /api/v1/organisations/{organisation_pk}/integrations/warehouse-connections/

Detail:

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

Request body

None.

Response — list (200 OK)

No connection configured:

[]

Connection exists (singleton, so array has one item):

[
  {
    "id": "wc_abc123",
    "type": "snowflake",
    "status": "connected",
    "config": {
      "account_identifier": "xy12345.us-east-1",
      "warehouse": "COMPUTE_WH",
      "database": "FLAGSMITH",
      "schema": "ANALYTICS",
      "role": "FLAGSMITH_LOADER",
      "user": "FLAGSMITH_SERVICE"
    },
    "public_key": "MIICIjANBgkq...",
    "setup_script": "-- Flagsmith Analytics\nUSE ROLE SYSADMIN;\n...",
    "created_at": "2026-04-17T10:00:00Z",
    "last_tested_at": "2026-04-17T10:05:00Z",
    "last_error": null
  }
]

Response — detail (200 OK)

Same object shape as a list item, returned unwrapped:

{
  "id": "wc_abc123",
  "type": "snowflake",
  "status": "connected",
  "config": { ... },
  "public_key": "MIICIjANBgkq...",
  "setup_script": "-- Flagsmith Analytics\nUSE ROLE SYSADMIN;\n...",
  "created_at": "2026-04-17T10:00:00Z",
  "last_tested_at": "2026-04-17T10:05:00Z",
  "last_error": null
}

Returns 404 Not Found if the connection does not exist.

Fields

Same shape as the POST response, with test-result fields populated if a test has run:

  • status: pending_customer_setup | connected | error
  • last_tested_at: timestamp of most recent test (null if never tested)
  • last_error: raw Snowflake error string from last failed test (null on success or never-tested)

Never returned

  • Private key (encrypted, lives in the secret store)
  • Any field marked sensitive by the warehouse type

Notes

  • setup_script is persisted and returned every time — lets the customer reopen the page and grab the SQL again without recreating the connection.

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