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

# Delete this store's own cross-store collection links

> Permanently deletes `merchant_id`'s own mapping rows (all, or the listed collections), which is what lets it disconnect. All or nothing: refused with 409 while another store still replicates from any of them; those stores unlink first. Never touches another store's rows.



## OpenAPI

````yaml /api-reference/openapi/lite.json post /multi-store/unlink-collections/{merchant_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/unlink-collections/{merchant_id}:
    post:
      summary: Delete this store's own cross-store collection links
      description: >-
        Permanently deletes `merchant_id`'s own mapping rows (all, or the listed
        collections), which is what lets it disconnect. All or nothing: refused
        with 409 while another store still replicates from any of them; those
        stores unlink first. Never touches another store's rows.
      operationId: multiStoreUnlinkCollections
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MultiStoreUnlinkRequest'
      responses:
        '200':
          description: Deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultiStoreUnlinkResponse'
        '400':
          description: 'The body failed the schema, or `error_code: NOT_IN_GROUP`.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  error_code:
                    type: string
                    enum:
                      - NOT_IN_GROUP
                required:
                  - 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 not found for this caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '409':
          description: 'Nothing deleted: other stores replicate from these collections.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultiStoreUnlinkWouldStrand'
        '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:
    MultiStoreUnlinkRequest:
      anyOf:
        - type: object
          properties:
            all:
              type: boolean
              enum:
                - true
          required:
            - all
          additionalProperties: false
        - type: object
          properties:
            collection_ids:
              type: array
              items:
                type: string
                minLength: 1
              minItems: 1
              maxItems: 1000
          required:
            - collection_ids
          additionalProperties: false
      description: >-
        Either `{all: true}` (every link this store has) or `{collection_ids}`
        (these collections of this store), never both.
    MultiStoreUnlinkResponse:
      type: object
      properties:
        unlinked:
          type: integer
        collection_ids:
          type: array
          items:
            type: string
        remaining:
          type: integer
          description: >-
            This store's mapping rows left in the group; 0 means it can now
            disconnect.
      required:
        - unlinked
        - collection_ids
        - remaining
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{detail}`.'
    MultiStoreUnlinkWouldStrand:
      type: object
      properties:
        detail:
          type: string
        error_code:
          type: string
          enum:
            - UNLINK_WOULD_STRAND
        blocked:
          type: array
          items:
            type: object
            properties:
              collection_id:
                type: string
              dependents:
                type: integer
              stores:
                type: array
                items:
                  type: string
            required:
              - collection_id
              - dependents
              - stores
        stores:
          type: array
          items:
            type: string
          description: >-
            Every sibling store still replicating from the requested
            collections; they must unlink first.
      required:
        - detail
        - error_code
        - blocked
        - stores
  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.

````