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

# Change an integration's config

> Changes the settings you send; the rest, and every query, stay. null clears allowed_schemas or allowed_tables (no limit). Tightening the allowlist is refused (422) while a saved query reads outside it. A 409 means the config changed since you read it (or `expected_version` is not the live one): read it again.



## OpenAPI

````yaml /api/statisfy-api.openapi.json patch /v1/integrations/{key}/config
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}/config:
    patch:
      tags:
        - integrations
      summary: Change an integration's config
      description: >-
        Changes the settings you send; the rest, and every query, stay. null
        clears allowed_schemas or allowed_tables (no limit). Tightening the
        allowlist is refused (422) while a saved query reads outside it. A 409
        means the config changed since you read it (or `expected_version` is not
        the live one): read it again.
      operationId: integrations_update_config
      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:
                allowed_schemas:
                  anyOf:
                    - items:
                        maxLength: 255
                        minLength: 1
                        type: string
                      type: array
                    - type: 'null'
                  default: null
                  description: null removes the limit
                  title: Allowed Schemas
                allowed_tables:
                  anyOf:
                    - items:
                        maxLength: 255
                        minLength: 1
                        type: string
                      type: array
                    - type: 'null'
                  default: null
                  description: null removes the limit
                  title: Allowed Tables
                default_catalog:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Default Catalog
                default_database:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Default Database
                default_project_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Default Project Id
                default_schema:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Default Schema
                default_warehouse:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Default Warehouse
                expected_version:
                  anyOf:
                    - minimum: 0
                      type: integer
                    - type: 'null'
                  default: null
                  description: >-
                    The config `version` you read. Sent: a change against a
                    version that is no longer live is a 409 and writes nothing
                    (0 = the config was never saved). Left out, the change
                    always lands
                  title: Expected Version
                max_bytes_billed:
                  anyOf:
                    - minimum: 1
                      type: integer
                    - type: 'null'
                  default: null
                  title: Max Bytes Billed
                week_start_day:
                  anyOf:
                    - maximum: 6
                      minimum: 0
                      type: integer
                    - type: 'null'
                  default: null
                  title: Week Start Day
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationConfig'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    IntegrationConfig:
      description: >-
        A SQL warehouse's settings. Its queries are their own resource
        (`/queries`).
      properties:
        allowed_schemas:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            The table allowlist's schemas: queries and browsing stay inside
            them. Null = no limit
          title: Allowed Schemas
        allowed_tables:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            The table allowlist's tables, as table or schema.table. Null = every
            table in the allowed schemas
          title: Allowed Tables
        default_catalog:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Databricks: the catalog unqualified names resolve in'
          title: Default Catalog
        default_database:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Snowflake: the database unqualified names resolve in'
          title: Default Database
        default_project_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 'BigQuery: the project queries run in'
          title: Default Project Id
        default_schema:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Snowflake, Databricks: the schema unqualified names resolve in'
          title: Default Schema
        default_warehouse:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Snowflake: the warehouse queries run on'
          title: Default Warehouse
        max_bytes_billed:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            BigQuery: the most bytes one /sql or /preview query may bill; null
            means 10 GB
          title: Max Bytes Billed
        post_processing:
          description: >-
            Derived metrics computed after product usage queries. Read-only
            here: set up by Statisfy
          items:
            $ref: '#/components/schemas/PostProcessingConfig'
          title: Post Processing
          type: array
        version:
          description: >-
            The config's version: send it as `expected_version` with a change (0
            = never saved)
          title: Version
          type: integer
        week_start_day:
          description: 'The day product usage weeks start on: 0 = Monday … 6 = Sunday'
          title: Week Start Day
          type: integer
      required:
        - version
        - week_start_day
        - allowed_schemas
        - allowed_tables
        - default_project_id
        - max_bytes_billed
        - default_warehouse
        - default_database
        - default_schema
        - default_catalog
        - post_processing
      title: IntegrationConfig
      type: object
    PostProcessingConfig:
      description: >-
        Post-processing computation that runs after product_usage queries
        complete.


        Hydrated against a closed registry in
        `warehouse.post_processing_registry`.

        The function name must be a known key in `POST_PROCESSING_FUNCTIONS`;
        the

        callable receives `(tenant_id, customer_id, start_date, period)` and is

        expected to write derived metrics back into product_usage_store.


        Why a registry instead of an importable Python path: JSON configs cross
        the

        network and are user-editable in the wizard. A closed registry keeps the

        apply path from invoking arbitrary Python.


        Why no `@field_validator` on `function`: Pydantic v2 fires field
        validators

        on every `model_validate`, so any process that calls
        `get_warehouse_config`

        would transitively import `post_processing_registry` →

        `vidyard_post_processing_methods` → `gateway.index` just to read a
        config.

        That's expensive and couples schema-loading to heavy modules.

        Garbage-in is handled at the only two boundaries that matter: the
        migration

        script's apply path (which constructs configs explicitly) and

        `WarehouseProcessor._run_post_processing` (which logs + skips unknown

        function names rather than crashing).
      properties:
        custom_field_key:
          description: Identifier shown in logs; the metric the function writes
          title: Custom Field Key
          type: string
        function:
          description: >-
            Registry key in
            warehouse.post_processing_registry.POST_PROCESSING_FUNCTIONS
          title: Function
          type: string
        period:
          default: MONTHLY
          description: >-
            Period passed to the function; controls the start_date alignment.
            Functions in the legacy redshift config all use MONTHLY.
          enum:
            - DAILY
            - WEEKLY
            - MONTHLY
          title: Period
          type: string
      required:
        - function
        - custom_field_key
      title: PostProcessingConfig
      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.