{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Sorting","description":"API documentation for Celonis APIs.","siteUrl":"https://developer.celonis.com/","keywords":"celonis developer portal, celonis apis, celonis api reference docs","lang":"en-US","llmstxt":{"hide":false,"description":"Celonis API documentation","sections":[{"title":"API Docs","description":"Available Celonis API Docs","includeFiles":["**/*.md"],"excludeFiles":[]},{"title":"API Specs","description":"All Celonis API specifications","includeFiles":["**/openapi.yaml"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"sorting","__idx":0},"children":["Sorting"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"data-endpoints","__idx":1},"children":["Data Endpoints"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/data"]}," endpoint provides the ability to allow sorting by using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sort"]}," query parameter:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sort"]}," : Comma separated list of fields that are being preceded by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"+\""]}," to display in ascending order, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"-\""]}," for"," ","descending order. For example: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sort=+opportunity_value,-opportunity_id"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note that if no +/- prefix is provided, the results will be sorted in ascending order (+) by default."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note also, the fields used for sorting must exist for the requested record."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"schema-endpoints","__idx":2},"children":["Schema Endpoints"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Schema endpoints also provide the ability to sort their results by leveraging the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sort"]}," query parameter as follows:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Multi-field sorting is not allowed, i.e. it is not possible to sort by more than one field."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Fields in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sort"]}," query param should be prefixed with a ‘+’ for ascending order or ‘-’ for descending order."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If no +/- prefix is provided, the results will be sorted in ascending order (+)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The results will be sorted as case insensitive."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some examples are:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Get all Knowledge Models: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/knowledge-models?sort=+id"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Get all Filters for a Knowledge Model: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/knowledge-models/{km_id}/filters?sort=-name"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Get all Records for a Knowledge Model: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/knowledge-models/{km_id}/records?sort=id"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Get all KPIs for a Knowledge Model: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/knowledge-models/{km_id}/kpis?sort=id"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Get all Fields (attributes, augmented attributes and flags) for a Record of a Knowledge Model: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/knowledge-models/{km_id}/records/{record_id}?sort=-id"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageSize"]}," refers to the events returned in the page."," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," refers to the total events still at the API."," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["content"]}," events as raw JSON."]}]},"headings":[{"value":"Sorting","id":"sorting","depth":1},{"value":"Data Endpoints","id":"data-endpoints","depth":2},{"value":"Schema Endpoints","id":"schema-endpoints","depth":2}],"frontmatter":{"seo":{"title":"Sorting"}},"lastModified":"2026-03-03T21:07:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/process-intelligence-apis/knowledge-model-api/features/sorting","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}