> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Check SQL

> Checks SQL without running it: one SELECT that parses in the warehouse's dialect, with no writes, inside the table allowlist. Returns the tables it reads. Safe to repeat.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/integrations/{key}/sql/validate
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/integrations/{key}/sql/validate:
    post:
      tags:
        - integrations
      summary: Check SQL
      description: >-
        Checks SQL without running it: one SELECT that parses in the warehouse's
        dialect, with no writes, inside the table allowlist. Returns the tables
        it reads. Safe to repeat.
      operationId: integrations_check_sql
      parameters:
        - description: The integration key, such as snowflake or salesforce
          in: path
          name: key
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                sql:
                  description: >-
                    One SELECT, in the warehouse's own dialect. It may use
                    {START_DATE}, {END_DATE}, {START_DATE_SQL} and
                    {END_DATE_SQL}, which each run fills with its period's dates
                  maxLength: 100000
                  minLength: 1
                  title: Sql
                  type: string
              required:
                - sql
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationSqlCheck'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    IntegrationSqlCheck:
      properties:
        errors:
          items:
            type: string
          title: Errors
          type: array
        outside_allowlist:
          description: Tables it reads that the table allowlist does not cover
          items:
            type: string
          title: Outside Allowlist
          type: array
        tables_referenced:
          items:
            type: string
          title: Tables Referenced
          type: array
        valid:
          description: One SELECT that parses, and inside the table allowlist
          title: Valid
          type: boolean
      required:
        - valid
        - errors
        - tables_referenced
        - outside_allowlist
      title: IntegrationSqlCheck
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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