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

# The collections dashboard: a sorted, filtered page with traffic

> Returns one page of the merchant's collections with their traffic over [from_date, to_date] (views, clicks, CTR), ordered by traffic (`top_views`, `top_ctr`, `top_clicks`) or metadata (`updated_at`, `name_a_z`, `number_of_products`), optionally filtered by status and title. Read-only; POST because the filters and date window travel as a JSON body. To page, pass the response's `offset` back while `has_next` is true.



## OpenAPI

````yaml /api-reference/openapi/lite.json post /collections/data-sorted-by
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:
  /collections/data-sorted-by:
    post:
      summary: 'The collections dashboard: a sorted, filtered page with traffic'
      description: >-
        Returns one page of the merchant's collections with their traffic over
        [from_date, to_date] (views, clicks, CTR), ordered by traffic
        (`top_views`, `top_ctr`, `top_clicks`) or metadata (`updated_at`,
        `name_a_z`, `number_of_products`), optionally filtered by status and
        title. Read-only; POST because the filters and date window travel as a
        JSON body. To page, pass the response's `offset` back while `has_next`
        is true.
      operationId: collectionsDataSortedBy
      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: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSortedCollectionsRequest'
      responses:
        '200':
          description: The page.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSortedCollectionsResponse'
        '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 not found for this caller.
          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:
    DataSortedCollectionsRequest:
      type: object
      properties:
        offset:
          type: integer
          minimum: 0
        page_size:
          type: integer
          minimum: 1
        query:
          type:
            - string
            - 'null'
          description: Case-insensitive title filter.
        order_by:
          type: string
          enum:
            - top_views
            - top_ctr
            - top_clicks
            - updated_at
            - name_a_z
            - number_of_products
          default: top_views
        from_date:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          example: '2026-09-01'
        to_date:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          example: '2026-09-01'
        reverse:
          type: boolean
        filter_by:
          type:
            - string
            - 'null'
          enum:
            - live
            - draft
            - scheduled
            - not_live
            - null
      required:
        - from_date
        - to_date
    DataSortedCollectionsResponse:
      type: object
      properties:
        offset:
          type: integer
          description: Where the next page starts.
        has_next:
          type: boolean
        collections:
          type: array
          items:
            $ref: '#/components/schemas/LiteDashboardCollectionDto'
      required:
        - offset
        - has_next
        - collections
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{detail}`.'
    LiteDashboardCollectionDto:
      allOf:
        - $ref: '#/components/schemas/LiteCollectionListDto'
        - type: object
          properties:
            selected_period_data:
              type: object
              properties:
                clicks:
                  type: number
                views:
                  type: number
                percentage_of_max_clicks:
                  type: number
                percentage_of_total_clicks:
                  type: number
                clickthrough_rate:
                  type:
                    - number
                    - 'null'
              required:
                - clicks
                - views
                - percentage_of_max_clicks
                - percentage_of_total_clicks
                - clickthrough_rate
          required:
            - selected_period_data
    LiteCollectionListDto:
      type: object
      properties:
        collection_id:
          type: string
          description: Numeric Shopify collection id.
        title:
          type: string
          description: Primary-locale title.
        handle:
          type: string
        image_urls:
          type: array
          items:
            type: string
        shopify_sort_order:
          $ref: '#/components/schemas/CollectionSortOrder'
        sort_order:
          $ref: '#/components/schemas/LiteCollectionSortOrder'
        has_depict_configuration:
          type: boolean
          description: >-
            Whether Depict has saved any configuration (sort, pins, content
            blocks…) for it.
        sync_back_to_shopify:
          type: boolean
          description: >-
            Active: Depict writes its order back to Shopify. False = the
            collection is not managed by Depict.
        unpin_oos:
          type: boolean
          description: Out-of-stock pinned products drop out of their pins.
        updated_at:
          type:
            - string
            - 'null'
          description: >-
            When the Depict configuration last changed (naive UTC); null on an
            inactive list row.
        shopify_updated_at:
          type: string
          description: Naive UTC.
        use_collection_specific_boost_bury:
          type: boolean
          description: >-
            True: the version's own boost/bury rules apply instead of the
            merchant-wide ones.
        main_version:
          type:
            - string
            - 'null'
          description: UUID of the published version; null on an inactive list row.
        n_products:
          type: integer
        n_pinned_main_product_ids:
          type:
            - integer
            - 'null'
        product_images:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Always present. Image URLs of the collection's first products; null
            when it has none, and always null on the paginated list unless
            `include_images=true`.
        has_scheduled_version:
          type: boolean
      required:
        - collection_id
        - title
        - handle
        - image_urls
        - shopify_sort_order
        - sort_order
        - has_depict_configuration
        - sync_back_to_shopify
        - unpin_oos
        - updated_at
        - shopify_updated_at
        - use_collection_specific_boost_bury
        - main_version
        - n_products
        - n_pinned_main_product_ids
        - product_images
        - has_scheduled_version
    CollectionSortOrder:
      type: string
      enum:
        - MANUAL
        - BEST_SELLING
        - ALPHA_ASC
        - ALPHA_DESC
        - CREATED
        - CREATED_DESC
        - PRICE_ASC
        - PRICE_DESC
        - MOST_RELEVANT
      description: The collection's own sort order in Shopify.
    LiteCollectionSortOrder:
      type: string
      enum:
        - ALPHA_ASC
        - ALPHA_DESC
        - BEST_SELLING
        - BEST_SELLING_BY_REVENUE
        - MOST_RELEVANT
        - TRENDING
        - TRENDING_BY_REVENUE
        - CREATED
        - CREATED_DESC
        - PRICE_ASC
        - PRICE_DESC
        - STOCK_DESC
        - CLICKS_DESC
        - METAFIELD_ASC
        - METAFIELD_DESC
        - MANUAL
      description: >-
        How Depict sorts the collection. MANUAL keeps the pinned order;
        METAFIELD_ASC/DESC sort by the version's `metafield_sort` key.
  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.

````