Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
CDPCloud Portal
Sitecore CDP Developer Documentation
  • Developing with Sitecore CDP
    • Base URL
        • Searching in a collection
        • Sorting search results
        • Paginating responses
    • Response codes
    • REST API Guest v2.1
    • REST API Guest data extension v2.1
    • REST API Order v2.1
    • REST API Order contact v2.1
    • REST API Order consumer v2.1
    • REST API Order data extension v2.1
    • REST API Order item data extension v2.1
    • REST API Audience export
  1. Using a collection resource
  1. REST APIs
  2. Using a collection resource
  3. Sorting search results

Sorting search results

You can sort search results by specifying a sort query parameter and a corresponding sort value (ASC or DESC case sensitive) on a collection resource URL. The example cURL call returns all someCollection resources ordered by the following:

  • The someCollection resource createdAt date sorted ascending (case insensitive).

  • The someCollection resource label sorted descending (case insensitive).

Sorting search results in someCollection resources:

curl -X GET '<baseURL>/v2/someCollection?sort=createdAt::ASC|label::DESC'
If you have suggestions for improving this article, let us know!

Documentation Assistant

This assistant uses AI to generate responses based on Sitecore documentation. While it has access to official sources, answers may be incomplete or inaccurate and should not be considered official advice or support.
Powered by
k
kapa.ai
Protected by reCAPTCHA

© Copyright 2026, Sitecore A/S or a Sitecore affiliated company.
All rights reserved.

Privacy policySitecore Trust CenterTerms of use