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

# Connect or release collections across the group's stores

> Puts `connect.collections` into one cross-store connection (an existing `group_collection_id`, or a new one) and/or releases `disconnect.collections` from theirs (the mapping row stays, unlinked). Every merchant named must belong to the group. Side effects: writes mapping rows; if the group has auto-replicate on, new links are stamped to replicate from its source. Connecting requires multi-store in the caller's plan (402 otherwise); releasing never does. Answers null.



## OpenAPI

````yaml /api-reference/openapi/lite.json post /multi-store/collection-mappings/{group_id}
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:
  /multi-store/collection-mappings/{group_id}:
    post:
      summary: Connect or release collections across the group's stores
      description: >-
        Puts `connect.collections` into one cross-store connection (an existing
        `group_collection_id`, or a new one) and/or releases
        `disconnect.collections` from theirs (the mapping row stays, unlinked).
        Every merchant named must belong to the group. Side effects: writes
        mapping rows; if the group has auto-replicate on, new links are stamped
        to replicate from its source. Connecting requires multi-store in the
        caller's plan (402 otherwise); releasing never does. Answers null.
      operationId: multiStoreCollectionMappingsUpdate
      parameters:
        - schema:
            type: string
            format: uuid
            description: >-
              The multi-store group's uuid (the merchant's
              `multi_store_group_id`).
          required: true
          description: >-
            The multi-store group's uuid (the merchant's
            `multi_store_group_id`).
          name: group_id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollectionMappingUpdateRequest'
      responses:
        '200':
          description: Written.
          content:
            application/json:
              schema:
                type: 'null'
        '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'
        '402':
          description: >-
            The plan does not include multi-store (Merchandising at Large or
            above).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Paywall'
        '403':
          description: Authenticated, but this identity may not call the API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '404':
          description: >-
            The caller is not in this group, or the body names a store outside
            it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '415':
          description: Content-Type is not application/json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
components:
  schemas:
    CollectionMappingUpdateRequest:
      type: object
      properties:
        connect:
          type:
            - object
            - 'null'
          properties:
            group_collection_id:
              type:
                - string
                - 'null'
              description: >-
                The connection to add these collections to; null (or empty)
                starts a new one.
            collections:
              type: array
              items:
                $ref: '#/components/schemas/LiteMultiStoreMerchantCollection'
          required:
            - group_collection_id
            - collections
        disconnect:
          type:
            - object
            - 'null'
          properties:
            collections:
              type: array
              items:
                $ref: '#/components/schemas/LiteMultiStoreMerchantCollection'
          required:
            - collections
          description: >-
            Collections to take out of their connection (their mapping row is
            kept, unlinked).
      required:
        - connect
        - disconnect
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{detail}`.'
    Paywall:
      type: object
      properties:
        detail:
          type: string
        code:
          type: string
          enum:
            - product_required
            - collection_limit_exceeded
            - installation_frozen
        product:
          type: string
          enum:
            - search
            - recs
            - vm
        limit:
          type: integer
      required:
        - detail
        - code
      description: >-
        402: the merchant's plan does not include this. Branch on `code`; show
        `detail`.
    LiteMultiStoreMerchantCollection:
      type: object
      properties:
        merchant_id:
          type: string
        collection_id:
          type: string
      required:
        - merchant_id
        - collection_id
  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.

````