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

# Update integration

> Enable, disable or configure an integration. Every integration accepts
`status`; the rest of the accepted keys depend on which integration it
is, and anything else is ignored.

- `SiteScanIntegration` also accepts `scan_frequency` (`weekly` or
  `monthly`; weekly is not available on free accounts) and
  `auto_add_vendors`.
- `GoogleConsentModeIntegration` also accepts `url_passthrough` and
  `ads_data_redaction`.

Enabling an integration may add its associated vendors to the account.

Scheduled scanning is a paid feature: on a free plan, setting
`SiteScanIntegration` to `active` or turning on `auto_add_vendors` is
refused with a `422`. Turning it off always works, so an account that
downgrades can still disable it.




## OpenAPI

````yaml put /integrations/{id}
openapi: 3.1.0
info:
  title: CookieChimp API
  description: |
    API for CookieChimp.com.

    ## Request bodies

    Resource endpoints expect the resource wrapped under its own key, e.g.
    `{"category": {"name": "Analytics"}}` rather than a bare object.
    `PUT /password` wraps in `user`. Two endpoints take their body unwrapped:
    `POST /auth`, which takes `email` and `password` at the top level, and
    `POST /consent-banners/from-template`, which takes `jurisdiction_id` —
    a selector for which template to build from, not an attribute of the
    banner it creates.

    ## Response envelopes

    Listing endpoints — including `GET /groups` and `GET /accounts` — return
    `{"pagination": {...}, "data": [...]}`. `GET /banner-templates` is the
    exception: it returns `{"data": [...]}` with no pagination, being a fixed
    catalogue rather than a collection of the account's records.
    Most single-resource endpoints
    return `{"data": {...}}`; a single group or account is returned unwrapped.
    Resource-deletion endpoints return `{"message": "..."}`; `DELETE /auth`
    returns an empty object.
  version: 1.2.0
servers:
  - url: https://cookiechimp.com/api/v1
security:
  - authorization: []
paths:
  /integrations/{id}:
    put:
      tags:
        - Integrations
      summary: Update integration
      description: |
        Enable, disable or configure an integration. Every integration accepts
        `status`; the rest of the accepted keys depend on which integration it
        is, and anything else is ignored.

        - `SiteScanIntegration` also accepts `scan_frequency` (`weekly` or
          `monthly`; weekly is not available on free accounts) and
          `auto_add_vendors`.
        - `GoogleConsentModeIntegration` also accepts `url_passthrough` and
          `ads_data_redaction`.

        Enabling an integration may add its associated vendors to the account.

        Scheduled scanning is a paid feature: on a free plan, setting
        `SiteScanIntegration` to `active` or turning on `auto_add_vendors` is
        refused with a `422`. Turning it off always works, so an account that
        downgrades can still disable it.
      operationId: updateIntegration
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/id'
      requestBody:
        description: Integration settings to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntegrationWriteRequest'
      responses:
        '200':
          description: Updated integration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationResponse'
        '400':
          $ref: '#/components/responses/AmbiguousAccount'
        '401':
          $ref: '#/components/responses/AccountTokenRequired'
        '403':
          $ref: '#/components/responses/AccountAdminRequired'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    account_id:
      name: account_id
      in: query
      description: |
        Which account to act on, as the account's API id. Only meaningful for a
        user API key, which may reach several accounts — an account key already
        identifies exactly one and ignores this.

        Accepted by the endpoints that declare it; others act on the account the
        key resolves to on its own.

        Optional for reads, where it narrows the request to that account.
        Required for writes that declare it when the key can reach more than one
        account: without it the request would act on an account it picked rather
        than one you named, so it is refused with a `400`.
      required: false
      schema:
        type: string
    id:
      name: id
      in: path
      description: ID of the resource
      required: true
      schema:
        type: string
  schemas:
    IntegrationWriteRequest:
      type: object
      properties:
        integration:
          $ref: '#/components/schemas/IntegrationWrite'
      required:
        - integration
      example:
        integration:
          status: active
          scan_frequency: monthly
          auto_add_vendors: true
    IntegrationResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Integration'
    IntegrationWrite:
      type: object
      description: >
        `status` applies to every integration. The remaining keys are only

        accepted by the integration that declares them; anything else is
        ignored.
      properties:
        status:
          type: string
          enum:
            - active
            - inactive
        scan_frequency:
          type: string
          enum:
            - weekly
            - monthly
          description: >
            `SiteScanIntegration` only. Weekly is not available on free
            accounts.
        auto_add_vendors:
          type: boolean
          description: '`SiteScanIntegration` only: add vendors a scan discovers.'
        url_passthrough:
          type: boolean
          description: '`GoogleConsentModeIntegration` only.'
        ads_data_redaction:
          type: boolean
          description: '`GoogleConsentModeIntegration` only.'
    Integration:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        type:
          type: string
          readOnly: true
          description: The integration class, e.g. `SiteScanIntegration`
        name:
          type: string
          readOnly: true
          description: Human-readable name
        status:
          type: string
          enum:
            - active
            - inactive
        short_description:
          type:
            - string
            - 'null'
          readOnly: true
        settings:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Integration-specific settings
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      example:
        id: int1
        type: SiteScanIntegration
        name: Site Scan
        status: active
        short_description: Scan your website for cookies on a schedule.
        settings:
          scan_frequency: monthly
          auto_add_vendors: false
        created_at: '2023-01-05T10:15:30Z'
        updated_at: '2023-02-01T08:00:00Z'
    Error:
      type: object
      description: |
        The standard error envelope, used for authentication, authorization,
        pagination and not-found errors.
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: integer
              message:
                type: string
      example:
        errors:
          - code: 401
            message: Invalid API Key
    ValidationError:
      type: object
      description: |
        Returned when a create or update fails validation. Each entry carries a
        single human-readable `error` string.
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              error:
                type: string
      example:
        errors:
          - error: Name can't be blank
  responses:
    AmbiguousAccount:
      description: |
        A user API key that can reach more than one account attempted a write
        without saying which account it meant. Pass `account_id` (the account's
        API id) as a query parameter. Account keys are never ambiguous.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 400
                message: >-
                  Specify account_id when the API key can access more than one
                  account
    AccountTokenRequired:
      description: |
        Missing or invalid API token, or a token that does not resolve to an
        account. Account-scoped endpoints accept an account token, or a user
        token whose user belongs to an account; partner tokens are rejected.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 401
                message: API key must belong to an account
    AccountAdminRequired:
      description: |
        The token resolved to a user who is not an admin of this account.
        Configuration changes are admin-only, mirroring the dashboard — a group
        admin qualifies even without a direct membership, since a group role
        supersedes one. Account tokens carry the account's own authority and
        never see this; reads are unaffected.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 403
                message: User must be an admin of this account
    NotFound:
      description: The record does not exist, or does not belong to the caller
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 404
                message: Record not found
    ValidationError:
      description: The record could not be saved
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    RateLimited:
      description: |
        Too many requests. The general limit is 300 requests per 5 minutes per
        API token; the auth endpoints are throttled more tightly per IP.
      headers:
        Retry-After:
          description: Seconds until the current rate-limit window resets
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 429
                message: Too many requests. Please retry later.
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      description: API token obtained from the login endpoint or the dashboard

````