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

# Run a saved query now (a SQL warehouse or Pendo)

> Starts a run of one saved query (202), as Run now does in the app. A product_usage query can backfill a range (start_date and end_date; for pendo, at most 90 days). For pendo, the NPS survey job has no saved query: start it with POST /v1/integrations/pendo/surveys/runs. When a run of its subtype is already in flight, nothing starts and that run comes back (200, already_running). A 409 means the CRM has not synced yet, which every non-CRM integration waits for. Poll /runs/{run_id} for the outcome.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/integrations/{key}/runs
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}/runs:
    post:
      tags:
        - integrations
      summary: Run a saved query now (a SQL warehouse or Pendo)
      description: >-
        Starts a run of one saved query (202), as Run now does in the app. A
        product_usage query can backfill a range (start_date and end_date; for
        pendo, at most 90 days). For pendo, the NPS survey job has no saved
        query: start it with POST /v1/integrations/pendo/surveys/runs. When a
        run of its subtype is already in flight, nothing starts and that run
        comes back (200, already_running). A 409 means the CRM has not synced
        yet, which every non-CRM integration waits for. Poll /runs/{run_id} for
        the outcome.
      operationId: integrations_start_run
      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:
                end_date:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: 'product_usage only: backfill to this day (YYYY-MM-DD)'
                  title: End Date
                query_id:
                  description: The saved query to run now
                  title: Query Id
                  type: string
                start_date:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: >-
                    product_usage only: backfill from this day (YYYY-MM-DD),
                    with end_date
                  title: Start Date
              required:
                - query_id
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationRunStarted'
          description: Successful Response
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationRunStarted'
          description: Accepted
      security:
        - HTTPBearer: []
components:
  schemas:
    IntegrationRunStarted:
      properties:
        message:
          title: Message
          type: string
        run_id:
          description: The new run, or the one already in flight
          title: Run Id
          type: integer
        started_at:
          format: date-time
          title: Started At
          type: string
        status:
          description: >-
            scheduled (202): the run starts now; already_running (200): a run of
            this subtype is in flight
          enum:
            - scheduled
            - already_running
          title: Status
          type: string
      required:
        - status
        - run_id
        - started_at
        - message
      title: IntegrationRunStarted
      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.