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

# Enable or disable every market in a market group

> Enables or disables Depict for all markets in the group. Disabling returns a warning with the number of active collection versions that target the group, and queues a Shopify sort sync for the merchant's active collections. Writes config.shopify_merchant_enabled_market.



## OpenAPI

````yaml /api-reference/openapi/lite.json put /{merchant_id}/market-groups/{group_id}/toggle
openapi: 3.1.0
info:
  title: Search & Merchandising API
  version: 1.0.0
  description: >-
    REST API behind Depict: Search & Merchandising, the native Shopify app:
    onboarding, collections, boost & bury, dashboards, A/B testing and
    multi-store management. Endpoints are served under the /api/lite prefix and
    are authenticated with the Shopify session token that App Bridge issues to
    the embedded app.
servers:
  - url: /api/lite
security:
  - ShopifySessionToken: []
paths:
  /{merchant_id}/market-groups/{group_id}/toggle:
    put:
      summary: Enable or disable every market in a market group
      description: >-
        Enables or disables Depict for all markets in the group. Disabling
        returns a warning with the number of active collection versions that
        target the group, and queues a Shopify sort sync for the merchant's
        active collections. Writes config.shopify_merchant_enabled_market.
      operationId: toggleMarketGroup
      parameters:
        - schema:
            type: string
            description: Lite merchant id, e.g. `shopify-<shop id>`.
          required: true
          description: Lite merchant id, e.g. `shopify-<shop id>`.
          name: merchant_id
          in: path
        - schema:
            type: string
            description: The market group id.
          required: true
          description: The market group id.
          name: group_id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
              required:
                - enabled
      responses:
        '200':
          description: The toggle result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToggleMarketGroupResponse'
        '400':
          description: >-
            The query, path or body failed the schema; `detail` carries zod's
            messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '401':
          description: Not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '403':
          description: Authenticated, but this identity may not call the API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '404':
          description: Merchant or market group not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
components:
  schemas:
    ToggleMarketGroupResponse:
      type: object
      properties:
        success:
          type: boolean
        enabled:
          type: boolean
        warning:
          type:
            - string
            - 'null'
          description: Set when disabling a group that active collection versions use.
        affected_versions_count:
          type: integer
          description: Active collection versions targeting the group (disable only).
      required:
        - success
        - enabled
        - warning
        - affected_versions_count
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{detail}`.'
  securitySchemes:
    ShopifySessionToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Shopify App Bridge session token of the embedded Depict: Search &
        Merchandising app. The shop in the token determines the merchant;
        merchant_id parameters must belong to that shop.

````