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

# Test a Snowflake account configuration

> Validate a proposed Snowflake account configuration without adding it.



## OpenAPI

````yaml https://api.select.dev/v2/openapi.json post /snowflake-accounts/actions/test
openapi: 3.1.0
info:
  title: SELECT API (v2)
  version: 0.1.0
servers:
  - url: https://api.select.dev/v2
    description: SELECT API v2
security: []
tags:
  - name: metrics
    description: >-
      Query cost and usage data across Snowflake, BigQuery, Databricks and
      Tableau. Each route is `POST /v2/metrics/<model>/query` for one semantic
      model. Every route takes the same body shape and returns the same response
      shape. Each route page gives guidance on when to use the route, and worked
      examples.


      ## Body shape


      | Field | Meaning |

      | --- | --- |

      | `measures` | Aggregates to compute, for example `sum_spend`. |

      | `dimensions` | Fields to group by. Each one is returned on every row. |

      | `filter_expression` | An `and`/`or` tree of filters on dimensions,
      applied before aggregation. |

      | `measure_filters` | Filters on measures, applied after aggregation. |

      | `sort` | The order of the rows: `[{"field": "sum_spend", "direction":
      "desc"}]`. |

      | `limit` | The maximum number of rows. Results are not paginated: `limit`
      cuts the result short, and there is no next page. Omit `limit` to get all
      rows. |

      | `aggregate` | Set `false` to list the rows with no grouping. See
      "Listing rows". |


      v2 accepts only `filter_expression`. The body refuses the legacy `filters`
      list.


      ## Filter on dates


      Filter on the `day` field. Use two filters (both bounds are inclusive):


      ```json

      {"operator": "and", "filters": [
        {"field": "day", "operator": ">=", "value": "2026-08-01"},
        {"field": "day", "operator": "<=", "value": "2026-08-31"}], "limit": 1000}
      ```


      Or use one relative filter: `{"field": "day", "operator": "in range",
      "value": "30D"}`. The values are `{N}D` and `{N}M` (the last N days or
      months, today included), `WTD`, `MTD`, `QTD`, `YTD`, and `LMTD` (the whole
      previous calendar month).


      - Do not filter on `hour`, `week`, `month` or `quarter` to bound a range.
      Filter on `day`, and use the coarser fields as dimensions.

      - A timestamp such as `start_time <= "2026-08-31"` compares to midnight
      and drops most of that day. Use `day`, or `start_time < "2026-09-01"`.

      - A snapshot route (for example `snowflake-storage-summary`) describes the
      current state, and a `day` filter does not bound its size and cost fields.
      On routes that join the snapshot to activity, `day` bounds only the
      activity fields. Each route page says which fields these are.


      ## Which measure is cost


      - `sum_spend` (or `spend`, or `cost` on some routes) is the dollar cost in
      the filtered period. Use it for "how much did we spend".

      - `*_annualized` measures extend the spend of the filtered period to a
      year: a `7D` range gives that week's spend times 365 / 7. They are
      projections, not spend.

      - On snapshot routes, `annual_cost`, `*_monthly_cost` and `*_annual_cost`
      are the current rate extended to a month or a year. A date range does not
      bound them.

      - Do not present any of these run-rates as spend in a period.

      - Databricks routes also give DBUs (for example `sum_task_usage`). DBUs
      are not dollars.


      The `spend` route is the consolidated cost of every platform. Use it for
      totals, trends and breakdowns by service. Use a platform route to explain
      what inside the platform caused the cost.


      ## Text values are case-sensitive


      Filter values must match the stored case. A value in the wrong case
      matches no rows, with no error. For example:


      - On `spend`, `connection_type` is `Snowflake`, `Bigquery` or
      `Databricks`, and `"snowflake"` matches nothing.

      - On `search`, `data-freshness` and `workload-metadata-suggestions`,
      `connection_type` is lowercase: `snowflake`, `bigquery`, `databricks`.

      - On `snowflake-workloads`, most `resource_type` values are lowercase keys
      (`query_pattern`, `dbt`), but the AI types are title case (`Cortex
      Analyst`).


      ## Usage groups


      A usage group set divides cost into named groups, such as departments or
      teams. To group by the groups of one set, name the set in `path`:


      ```json

      {"dimensions": [{"field": "usage_group", "path": ["Department"]}],
      "limit": 1000}

      ```


      `path[0]` is the name of the set, not its ID. A plain `"usage_group"`
      dimension groups by every set at once. The same `{"field": ..., "path":
      [...]}` form reads keys of other semi-structured fields, for example
      workload metadata.


      ## Period over period


      Some routes publish `<measure>_previous_period`, `change_<measure>` and
      `percent_change_<measure>`. These measures need one bounded date range on
      `day`, at the top level of `filter_expression`:


      - Use two bounds on `day`, or one `in range` filter. Do not mix the two
      forms.

      - Do not nest the date filter in a sub-expression, and do not bound the
      range with `month` or `quarter`.

      - The previous period is the same number of days, just before the range.
      For `QTD` on 2026-09-28 (2026-07-01 to 2026-09-28, 90 days), the previous
      period is 2026-04-02 to 2026-06-30, not the previous calendar quarter.


      ## Listing rows


      Set `"aggregate": false` and name only `dimensions` to get the rows as
      they are, for example the individual queries that ran longer than ten
      minutes. If the body also names `measures` or `measure_filters`, the route
      aggregates, with no error. Always set a `limit` on a listing.


      ## Default scoping filters


      Some tables hold more than one kind of row, and the SELECT app filters to
      one kind by default. Each route page names these filters. For example:


      - `snowflake-query-patterns`: `{"field": "resource_type", "operator":
      "in", "values": ["query_pattern"]}`. `bigquery-query-patterns` filters
      `workload_type` to `bigquery_query_pattern`, and
      `databricks-query-patterns` filters `resource_type` to
      `databricks_query_pattern`.

      - `snowflake-dbt`: `{"field": "dbt_node_resource_type", "operator": "=",
      "value": "model"}`. Without it, tests, seeds and snapshots rank with
      models. The same filter applies to `bigquery-dbt-queries` and
      `databricks-dbt-queries`.


      ## Teams


      Send `X-Team-Id` to evaluate a query as a team you belong to. The rows are
      then limited to what the team's roles can reach.


      ## Which route answers which question


      | Question | Route |

      | --- | --- |

      | Total spend, spend trend, spend by platform, service or usage group |
      `spend` |

      | Most expensive Snowflake warehouses | `snowflake-workloads` (or
      `snowflake-warehouses` for metering spend) |

      | Warehouse utilization, idle spend, cluster usage |
      `snowflake-warehouses`, `snowflake-warehouse-clusters` |

      | Query latency, spillage and bytes scanned on a warehouse |
      `snowflake-warehouse-query-performance` |

      | Most expensive recurring queries | `snowflake-query-patterns` |

      | Individual queries | `snowflake-queries` |

      | Cost of dbt models, and of dbt runs | `snowflake-dbt`,
      `snowflake-dbt-invocations` |

      | Cost of tasks, stored procedures, dynamic tables | `snowflake-tasks`,
      `snowflake-stored-procedures`, `snowflake-dynamic-tables` |

      | Cost of BI tools (Looker, Mode, Hex, Sigma, Periscope, Tableau) |
      `snowflake-looker`, `snowflake-mode`, `snowflake-hex`, `snowflake-sigma`,
      `snowflake-periscope`, `tableau-queries` |

      | Cost of Fivetran, and of workloads defined by query tags |
      `snowflake-fivetran`, `snowflake-custom-workloads` |

      | Serverless, automatic clustering and Snowpipe cost |
      `snowflake-serverless`, `snowflake-automatic-clustering`,
      `snowflake-snowpipe` |

      | Storage cost in a period | `snowflake-storage`, `bigquery-storage-spend`
      |

      | Largest or unused tables now | `snowflake-storage-summary`,
      `bigquery-storage-summary` |

      | Which workloads read or write a table | `lineage-workloads`,
      `lineage-tables`, `lineage-edges` |

      | BigQuery cost by project, job or query pattern | `bigquery-projects`,
      `bigquery-jobs`, `bigquery-query-patterns` |

      | BigQuery reservations and commitments | `bigquery-reservation-timeline`,
      `bigquery-commitments`, `bigquery-commitment-scopes` |

      | Databricks cost by job, query, SQL warehouse or cluster |
      `databricks-jobs`, `databricks-queries`, `databricks-sql-warehouses`,
      `databricks-clusters` |

      | Savings from SELECT actions | `action-realized-savings` |

      | How current the data is | `data-freshness` |
paths:
  /snowflake-accounts/actions/test:
    post:
      tags:
        - snowflake-accounts
      summary: Test a Snowflake account configuration
      description: Validate a proposed Snowflake account configuration without adding it.
      operationId: test_snowflake_account_config_route_snowflake_accounts_actions_test_post
      parameters:
        - name: x-tenant-id
          in: header
          required: true
          schema:
            type: string
            description: The organization ID the request is scoped to.
            title: X-Tenant-Id
          description: The organization ID the request is scoped to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SnowflakeAccountCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnowflakeAccountValidationReport'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '408':
          $ref: '#/components/responses/RequestTimeout'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - HTTPBearer: []
components:
  schemas:
    SnowflakeAccountCreate:
      properties:
        id:
          type: string
          title: Id
          description: >-
            The account's Snowflake identifier, in `ORGANIZATION-ACCOUNT` form
            (e.g. `acme-us-east-1`). Cannot be changed once the account is
            added.


            Must already be normalized: lower case, no surrounding whitespace,
            and `-` rather than `.` between organization and account. A
            PrivateLink identifier, which ends in `.privatelink`, keeps its dots
            because the host it resolves to does. A value that is not already
            normalized is rejected rather than rewritten, so what you submit
            always matches what a subsequent read returns.
        name:
          type: string
          title: Name
          description: Display name for the account, as shown throughout SELECT.
        credentials:
          $ref: '#/components/schemas/SnowflakeCredentials'
          description: How SELECT authenticates to the account.
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
          description: >-
            The Snowflake role SELECT assumes when reading this account. Null
            uses the user's default role.
        warehouse:
          anyOf:
            - type: string
            - type: 'null'
          title: Warehouse
          description: >-
            The Snowflake warehouse SELECT runs its queries on. Null uses the
            user's default warehouse.
        describe_object_sproc_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Describe Object Sproc Name
          description: >-
            Fully qualified name of the stored procedure SELECT calls to
            describe objects it cannot read directly. Null if there is none.
        export_storage_integration_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Export Storage Integration Name
          description: >-
            Name of the Snowflake storage integration used to export data to
            SELECT. Mutually exclusive with `export_stage_name`.
        export_stage_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Export Stage Name
          description: >-
            Fully qualified name of the Snowflake stage used to export data to
            SELECT. Mutually exclusive with `export_storage_integration_name`.
        compute_cost_per_credit:
          anyOf:
            - type: number
            - type: 'null'
          title: Compute Cost Per Credit
          description: >-
            Overrides the credit rate SELECT reads from Snowflake when costing
            compute. Required together with `storage_cost_per_tb` when the
            account cannot read organization-level rates.
        storage_cost_per_tb:
          anyOf:
            - type: number
            - type: 'null'
          title: Storage Cost Per Tb
          description: >-
            Overrides the rate SELECT uses when costing storage, per terabyte
            per month. Required together with `compute_cost_per_credit` when the
            account cannot read organization-level rates.
        customer_side_sanitization_database_schema:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Side Sanitization Database Schema
          description: >-
            `DATABASE.SCHEMA` hosting your own sanitized copies of Snowflake's
            account usage views, which SELECT reads instead of the originals.
            Null disables the redirection.
        customer_side_sanitization_views:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Customer Side Sanitization Views
          description: >-
            The account usage views to redirect, such as `query_history`. Null
            redirects every view SELECT reads. Requires
            `customer_side_sanitization_database_schema`.
        excluded_users_filter_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Excluded Users Filter Expression
          description: >-
            JSON-encoded filter selecting Snowflake users whose activity is
            excluded from SELECT's cost and usage figures.
          x-doit-confidentiality: customer-data
          x-doit-pii: true
        fivetran_users:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Fivetran Users
          description: >-
            Snowflake users that Fivetran runs as, so their activity is
            attributed to Fivetran.
          x-doit-confidentiality: customer-data
          x-doit-pii: true
        mode_workspace:
          anyOf:
            - type: string
            - type: 'null'
          title: Mode Workspace
          description: The Mode workspace to attribute queries to.
        mode_token_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Mode Token Id
          description: Identifier of the Mode API token SELECT uses.
        mode_token_secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Mode Token Secret
          description: The Mode API token secret.
          writeOnly: true
          x-doit-confidentiality: sensitive
          x-terraform-sensitive: true
        sync_enabled:
          type: boolean
          title: Sync Enabled
          description: Whether SELECT starts syncing data for this account.
          default: true
        query_sanitization_enabled:
          type: boolean
          title: Query Sanitization Enabled
          description: Whether query text is sanitized before SELECT stores it.
          default: false
      type: object
      required:
        - id
        - name
        - credentials
      title: SnowflakeAccountCreate
      description: >-
        The configuration SELECT needs to start reading a Snowflake account.


        Every field here is returned by a read of the created account, except
        the

        credentials, which are write-only and never returned.
    SnowflakeAccountValidationReport:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether every applicable check passed.
        checks:
          items:
            $ref: '#/components/schemas/SnowflakeAccountValidationCheck'
          type: array
          title: Checks
          description: >-
            The checks that ran, in the order they ran. Read top-down to find
            where setup stopped working.
      type: object
      required:
        - success
        - checks
      title: SnowflakeAccountValidationReport
      description: The result of validating an account's configuration against Snowflake.
    SnowflakeCredentials:
      properties:
        authentication_method:
          type: string
          enum:
            - password
            - key_pair
            - workload_identity_federation
          title: Authentication Method
          description: Which authentication method SELECT uses for this account.
        username:
          anyOf:
            - type: string
            - type: 'null'
          title: Username
          description: >-
            The Snowflake user SELECT connects as. Required for `password` and
            `key_pair`; omitted for `workload_identity_federation`.
        password:
          anyOf:
            - type: string
            - type: 'null'
          title: Password
          description: That user's password. Required for `password`.
          writeOnly: true
          x-doit-confidentiality: sensitive
          x-terraform-sensitive: true
        private_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Private Key
          description: >-
            PEM-encoded private key for that user, including the `-----BEGIN
            PRIVATE KEY-----` and `-----END PRIVATE KEY-----` lines. Required
            for `key_pair`.
          writeOnly: true
          x-doit-confidentiality: sensitive
          x-terraform-sensitive: true
        private_key_passphrase:
          anyOf:
            - type: string
            - type: 'null'
          title: Private Key Passphrase
          description: >-
            Passphrase protecting the private key, if it is encrypted. Only
            valid for `key_pair`.
          writeOnly: true
          x-doit-confidentiality: sensitive
          x-terraform-sensitive: true
      type: object
      required:
        - authentication_method
      title: SnowflakeCredentials
      description: >-
        How SELECT authenticates to a Snowflake account.


        Supply the fields belonging to the chosen `authentication_method`:


        - `password` — `username` and `password`.

        - `key_pair` — `username` and `private_key`, plus
        `private_key_passphrase` if
          the key is encrypted.
        - `workload_identity_federation` — nothing else. Snowflake resolves the
        user
          from its own workload identity mapping.

        Supplying a field that does not belong to the chosen method is rejected,
        so a

        leftover value cannot silently change how SELECT connects.
    SnowflakeAccountValidationCheck:
      properties:
        id:
          type: string
          enum:
            - connectivity
            - permissions
            - describe_object_sproc
            - account_identity
            - org_admin
            - mode_bi
          title: Id
          description: Identifies which check this is.
        label:
          type: string
          title: Label
          description: Short human-readable name for the check.
        status:
          type: string
          enum:
            - passed
            - failed
            - skipped
          title: Status
          description: >-
            `passed`, `failed`, or `skipped`. A check is skipped when it does
            not apply, or when an earlier check failed and stopped the run.
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: >-
            What to change when the check failed, or why it was skipped. Null
            when the check passed with nothing worth noting.
      type: object
      required:
        - id
        - label
        - status
      title: SnowflakeAccountValidationCheck
      description: One check SELECT runs against an account's configuration.
    ProblemDetail:
      additionalProperties: true
      description: >-
        RFC 9457-style error payload, served as ``application/problem+json``.


        ``code`` is the stable, machine-readable identifier — consumers branch
        on it,

        never on ``title``. ``type`` stays ``about:blank``: we keep no per-error

        documentation pages. There is no ``instance``/request-id member (we
        don't run

        access logs). See the flat error-code catalogue in §4 of the standards
        doc.
      properties:
        type:
          default: about:blank
          title: Type
          type: string
        title:
          type: string
          title: Title
        status:
          title: Status
          type: integer
        detail:
          title: Detail
          type: string
        code:
          $ref: '#/components/schemas/ErrorCode'
        retryable:
          title: Retryable
          type: boolean
        details:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          default: null
          title: Details
      required:
        - title
        - status
        - detail
        - code
        - retryable
      title: ProblemDetail
      type: object
    ErrorCode:
      type: string
      enum:
        - validation_failed
        - unauthorized
        - invalid_token
        - forbidden
        - not_found
        - tenant_id_required
        - tenant_mismatch
        - conflict
        - delete_blocked_by_dependencies
        - query_profile_unavailable
        - insight_auto_closed
        - integration_credentials_rejected
        - describe_procedure_unavailable
        - missing_grant
        - monitor_run_without_period
        - template_render_failed
        - response_too_large
        - precondition_failed
        - precondition_required
        - quota_exceeded
        - rate_limited
        - filter_key_not_supported
        - pagination_token_expired
        - pagination_token_invalid
        - internal_error
        - service_unavailable
      title: ErrorCode
      description: >-
        The machine-readable identifier of an error.


        Clients branch on this, never on ``title`` or ``detail``. A published
        code keeps

        its meaning; new codes may be added.
  responses:
    BadRequest:
      description: Bad request
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      headers:
        WWW-Authenticate:
          description: Authentication challenge for the requested resource.
          required: true
          schema:
            type: string
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    NotFound:
      description: Not found
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    MethodNotAllowed:
      description: Method not allowed
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      headers:
        Allow:
          description: HTTP methods supported by the requested resource.
          required: true
          schema:
            type: string
    RequestTimeout:
      description: Request Timeout
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    Conflict:
      description: Conflict
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    ValidationFailed:
      description: Validation failed
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    RateLimited:
      description: Rate limited
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          required: true
          schema:
            type: integer
            minimum: 0
    InternalError:
      description: Internal error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    ServiceUnavailable:
      description: Service unavailable
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          required: true
          schema:
            type: integer
            minimum: 0
  securitySchemes:
    HTTPBearer:
      type: http
      description: Organization API key (sl_…).
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.