> ## 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.

# Get one saved query

> Returns one saved query.



## OpenAPI

````yaml /api/statisfy-api.openapi.json get /v1/integrations/{key}/queries/{query_id}
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}/queries/{query_id}:
    get:
      tags:
        - integrations
      summary: Get one saved query
      description: Returns one saved query.
      operationId: integrations_get_query
      parameters:
        - description: The integration key, such as snowflake or salesforce
          in: path
          name: key
          required: true
          schema:
            type: string
        - in: path
          name: query_id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationQuery'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    IntegrationQuery:
      description: >-
        A saved query as stored. Its resolver, mapping and transformer objects
        have the same

        shapes a create or a change takes.
      properties:
        account_resolver:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Account Resolver
        custom_field_mappings:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Custom Field Mappings
        custom_object_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Custom Object Config
        entity_type:
          enum:
            - account
            - people
          title: Entity Type
          type: string
        group_by_columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Group By Columns
        id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Stable id. Null only on a query saved before ids existed: any save
            of the config gives it one
          title: Id
        is_active:
          title: Is Active
          type: boolean
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit
        name:
          title: Name
          type: string
        order_by_columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Order By Columns
        period:
          anyOf:
            - enum:
                - HOURLY
                - TWO_HOURS
                - FOUR_HOURS
                - SIX_HOURS
                - TWELVE_HOURS
                - DAILY
                - WEEKLY
                - MONTHLY
              type: string
            - type: 'null'
          title: Period
        person_resolver:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Person Resolver
        product_usage_mappings:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Product Usage Mappings
        query_type:
          enum:
            - custom_field
            - product_usage
            - custom_object
          title: Query Type
          type: string
        sql:
          title: Sql
          type: string
        transformers:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Transformers
        version:
          description: 'The config''s version: send it as `expected_version` with a change'
          title: Version
          type: integer
      required:
        - id
        - version
        - name
        - query_type
        - sql
        - entity_type
        - period
        - group_by_columns
        - order_by_columns
        - limit
        - account_resolver
        - person_resolver
        - custom_field_mappings
        - product_usage_mappings
        - custom_object_config
        - transformers
        - is_active
      title: IntegrationQuery
      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.