Sort Parameter Format

field:direction,field2:direction2
  • field: The field name to sort by
  • direction: 1 for ascending, -1 for descending

Examples

Single Field Sort

# Sort by name ascending
curl -X GET "https://cloud-api.pland.app/v2/users?sort=name:1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Sort by created date descending
curl -X GET "https://cloud-api.pland.app/v2/users?sort=status.createdAt:-1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Multiple Field Sort

# Sort by name ascending, then by created date descending
curl -X GET "https://cloud-api.pland.app/v2/users?sort=name:1,status.createdAt:-1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Common Sort Fields

EntityCommon Fields
Usersname, email, status.createdAt
Objectsname, number, status.createdAt
Customersname, number, status.createdAt
Jobstitle, startDate, status.createdAt

Nested Field Sorting

For nested objects, use dot notation:
# Sort by status creation date
sort=status.createdAt:-1

# Sort by object name
sort=object.name:1